Skip to content

Commit ea7f3e3

Browse files
committed
Spurious selections not cleared to avoid side-effects.
1 parent dade3cc commit ea7f3e3

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
### v3.0.1 (2 October 2017)
2+
3+
* [BUGFIX] Stop clearing the selection after an animation since it causes child form inputs to lose focus on each update. (#50)
4+
15
### v3.0.0 (27 August 2017)
26

7+
##### Breaking change
8+
9+
* [FEATURE] The `isLeaving` prop is only added to children if opted in with `notifyLeaving={true}` since it's
10+
a departure from `react-transition-group` features.
11+
12+
##### Non-breaking changes
13+
314
* [ENHANCEMENT] Treat a child rendering `null` as if there is no child; specifically helps avoid errors with RR4.
415
* [ENHANCEMENT] Maintain component callback refs by not overwriting with string refs similar to `react-transition-group`.
5-
* [FEATURE] Only add the `isLeaving` prop to children if opted in with `notifyLeaving={true}` since it's
6-
a departure from `react-transition-group` features.
716
* [ENHANCEMENT] Use `requestAnimationFrame` to queue the height transition rather than a timeout.
817
* [ENHANCEMENT] Handle the enter and leave animation of changes due to successive child updates before the current transition ends.
918
* [ENHANCEMENT] Clear the selection after transitions to avoid the child being selected after multiple clicks.

src/ReactCSSTransitionReplace.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import chain from 'chain-function'
1111
import warning from 'warning'
1212

1313
import raf from 'dom-helpers/util/requestAnimationFrame'
14-
import { clearSelection } from './utils/dom-helpers'
1514

1615
import ReactCSSTransitionReplaceChild from './ReactCSSTransitionReplaceChild'
1716
import { transitionTimeout } from 'react-transition-group/utils/PropTypes'
@@ -130,11 +129,6 @@ export default class ReactCSSTransitionReplace extends React.Component {
130129
const keysToLeave = this.keysToLeave
131130
this.keysToLeave = []
132131
keysToLeave.forEach(this.performLeave)
133-
134-
// When the enter completes and the component switches to relative positioning the
135-
// child often gets selected after multiple clicks (at least in Chrome). To compensate
136-
// the current selection is cleared whenever the component updates.
137-
clearSelection()
138132
}
139133

140134
performAppear(key) {

src/utils/dom-helpers.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)