Skip to content

Commit aeda256

Browse files
authored
Merge pull request react-bootstrap#5717 from react-bootstrap/merge-master
Merge master into bs5-dev
2 parents 905bf8a + 9c95a59 commit aeda256

File tree

9 files changed

+179
-150
lines changed

9 files changed

+179
-150
lines changed

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [1.5.2](https://github.com/react-bootstrap/react-bootstrap/compare/v1.5.1...v1.5.2) (2021-03-11)
2+
3+
4+
### Bug Fixes
5+
6+
* **Carousel:** fix crossfade animation ([#5671](https://github.com/react-bootstrap/react-bootstrap/issues/5671)) ([a24ab44](https://github.com/react-bootstrap/react-bootstrap/commit/a24ab44b0c80b38ad2efd9762f47a833cc2cf0ad))
7+
8+
9+
10+
11+
112
## [1.5.1](https://github.com/react-bootstrap/react-bootstrap/compare/v1.5.0...v1.5.1) (2021-03-02)
213

314

package.json

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-bootstrap",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "Bootstrap 4 components built with React",
55
"keywords": [
66
"react",
@@ -46,12 +46,8 @@
4646
"tdd": "karma start",
4747
"test": "npm run lint && npm run test-browser && npm run test-node",
4848
"test-browser": "cross-env NODE_ENV=test karma start --single-run",
49-
"test-node": "cross-env NODE_ENV=test-server mocha test/server/*Spec.js"
50-
},
51-
"husky": {
52-
"hooks": {
53-
"pre-commit": "lint-staged"
54-
}
49+
"test-node": "cross-env NODE_ENV=test-server mocha test/server/*Spec.js",
50+
"prepare": "husky install"
5551
},
5652
"lint-staged": {
5753
"*.{js,ts,tsx}": "eslint --fix"
@@ -83,14 +79,14 @@
8379
"devDependencies": {
8480
"@4c/rollout": "^2.2.0",
8581
"@4c/tsconfig": "^0.3.1",
86-
"@babel/cli": "^7.13.0",
87-
"@babel/core": "^7.13.8",
82+
"@babel/cli": "^7.13.10",
83+
"@babel/core": "^7.13.10",
8884
"@babel/preset-typescript": "^7.13.0",
8985
"@babel/register": "^7.13.8",
9086
"@react-bootstrap/babel-preset": "^2.0.0",
9187
"@react-bootstrap/eslint-config": "^2.0.0",
92-
"@typescript-eslint/eslint-plugin": "^4.16.1",
93-
"@typescript-eslint/parser": "^4.16.1",
88+
"@typescript-eslint/eslint-plugin": "^4.17.0",
89+
"@typescript-eslint/parser": "^4.17.0",
9490
"babel-eslint": "^10.1.0",
9591
"babel-loader": "^8.2.2",
9692
"babel-plugin-istanbul": "^6.0.0",
@@ -110,13 +106,13 @@
110106
"eslint-import-resolver-webpack": "^0.13.0",
111107
"eslint-plugin-import": "^2.22.1",
112108
"eslint-plugin-jsx-a11y": "^6.4.1",
113-
"eslint-plugin-mocha": "^8.0.0",
109+
"eslint-plugin-mocha": "^8.1.0",
114110
"eslint-plugin-prettier": "^3.3.1",
115111
"eslint-plugin-react": "^7.22.0",
116112
"execa": "^5.0.0",
117113
"fs-extra": "^9.1.0",
118-
"husky": "^4.3.8",
119-
"karma": "^6.1.1",
114+
"husky": "^5.1.3",
115+
"karma": "^6.2.0",
120116
"karma-chrome-launcher": "^3.1.0",
121117
"karma-cli": "^2.0.0",
122118
"karma-coverage": "^2.0.3",
@@ -128,7 +124,7 @@
128124
"karma-webpack": "^5.0.0",
129125
"lint-staged": "^10.5.4",
130126
"lodash": "^4.17.21",
131-
"mocha": "^8.3.0",
127+
"mocha": "^8.3.1",
132128
"prettier": "^2.2.1",
133129
"react": "^16.14.0",
134130
"react-dom": "^16.14.0",
@@ -137,8 +133,8 @@
137133
"sinon": "^9.2.4",
138134
"sinon-chai": "^3.5.0",
139135
"stream-browserify": "^3.0.0",
140-
"typescript": "^4.2.2",
141-
"webpack": "^5.24.3"
136+
"typescript": "^4.2.3",
137+
"webpack": "^5.24.4"
142138
},
143139
"peerDependencies": {
144140
"react": ">=16.14.0",

src/Carousel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import useUpdateEffect from '@restart/hooks/useUpdateEffect';
33
import useCommittedRef from '@restart/hooks/useCommittedRef';
44
import useTimeout from '@restart/hooks/useTimeout';
55
import classNames from 'classnames';
6-
import transitionEnd from 'dom-helpers/transitionEnd';
76
import { TransitionStatus } from 'react-transition-group/Transition';
87
import PropTypes from 'prop-types';
98
import * as React from 'react';
@@ -21,6 +20,7 @@ import CarouselItem from './CarouselItem';
2120
import { map, forEach } from './ElementChildren';
2221
import SafeAnchor from './SafeAnchor';
2322
import { useBootstrapPrefix } from './ThemeProvider';
23+
import transitionEndListener from './transitionEndListener';
2424
import triggerBrowserReflow from './triggerBrowserReflow';
2525
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2626
import TransitionWrapper from './TransitionWrapper';
@@ -544,7 +544,7 @@ const Carousel: BsPrefixRefForwardingComponent<
544544
in={isActive}
545545
onEnter={isActive ? handleEnter : undefined}
546546
onEntered={isActive ? handleEntered : undefined}
547-
addEndListener={transitionEnd}
547+
addEndListener={transitionEndListener}
548548
>
549549
{(
550550
status: TransitionStatus,

src/transitionEndListener.ts

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1+
import css from 'dom-helpers/css';
12
import transitionEnd from 'dom-helpers/transitionEnd';
23

4+
function parseDuration(
5+
node: HTMLElement,
6+
property: 'transitionDuration' | 'transitionDelay',
7+
) {
8+
const str = css(node, property) || '';
9+
const mult = str.indexOf('ms') === -1 ? 1000 : 1;
10+
return parseFloat(str) * mult;
11+
}
12+
313
export default function transitionEndListener(
414
element: HTMLElement,
515
handler: (e: TransitionEvent) => void,
616
) {
7-
const remove = transitionEnd(element, (e) => {
8-
if (e.target === element) {
9-
remove();
10-
handler(e);
11-
}
12-
});
17+
const duration = parseDuration(element, 'transitionDuration');
18+
const delay = parseDuration(element, 'transitionDelay');
19+
const remove = transitionEnd(
20+
element,
21+
(e) => {
22+
if (e.target === element) {
23+
remove();
24+
handler(e);
25+
}
26+
},
27+
duration + delay,
28+
);
1329
}

www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"dom-helpers": "^5.2.0",
4949
"fibers": "^5.0.0",
5050
"formik": "^2.2.6",
51-
"gatsby": "^2.32.9",
51+
"gatsby": "^2.32.11",
5252
"gatsby-plugin-astroturf": "^0.2.1",
5353
"gatsby-plugin-catch-links": "^2.10.0",
5454
"gatsby-plugin-mdx": "^1.10.1",

www/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6060,10 +6060,10 @@ gatsby-transformer-remark@^2.16.1:
60606060
unist-util-select "^1.5.0"
60616061
unist-util-visit "^1.4.1"
60626062

6063-
gatsby@^2.32.9:
6064-
version "2.32.9"
6065-
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-2.32.9.tgz#8ce47133b143acaa577f8cf0907be89afa3fa514"
6066-
integrity sha512-4QyrOUGLG6V51YSOJW+cFmRDcey6DnF8YMbsOQ1efp9MJ91fSgOI3r6dYd6lc1lJwppN4KZWbqE9WOXtFgda7w==
6063+
gatsby@^2.32.11:
6064+
version "2.32.11"
6065+
resolved "https://registry.yarnpkg.com/gatsby/-/gatsby-2.32.11.tgz#2f4fdf5b8a007e5a3596107992388e6c4d1de4c7"
6066+
integrity sha512-y1L/WB6bEsbtr3cThykVG+ynParU6ndIQW5TWTvfajsBGSOpi8kcU5LNjIM4VWb1JzgHdzUM6kALII6+bRqZew==
60676067
dependencies:
60686068
"@babel/code-frame" "^7.10.4"
60696069
"@babel/core" "^7.12.3"

0 commit comments

Comments
 (0)