Skip to content

Commit

Permalink
FIX Popover toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 3, 2023
1 parent 177c9ad commit ee30f31
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion client/src/components/ActionMenu/ActionMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class ActionMenu extends PureComponent {

// Force setting state to the end of the execution queue to clear a potential race condition
// with entwine click handlers
window.setTimeout(() => this.setState((prevState) => ({ isOpen: !prevState.isOpen })), 0);
//
// ignore linting rule because following the recommended replacement caused behat failures
// eslint-disable-next-line react/no-access-state-in-setstate
window.setTimeout(() => this.setState({ isOpen: !this.state.isOpen }), 0);
}

render() {
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/PopoverField/PopoverField.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class PopoverField extends Component {

// Force setting state to the end of the execution queue to clear a potential race condition
// with entwine click handlers
window.setTimeout(() => this.setState((prevState) => ({ isOpen: !prevState.isOpen }), toggleCallback), 0);
//
// ignore linting rule because following the recommended replacement caused behat failures
// eslint-disable-next-line react/no-access-state-in-setstate
window.setTimeout(() => this.setState({ isOpen: !this.state.isOpen }, toggleCallback), 0);
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class PopoverOptionSetToggle extends Component {
handleToggle() {
// Force setting state to the end of the execution queue to clear a potential race condition
// with entwine click handlers
window.setTimeout(() => this.setState((prevState) => ({ isOpen: !prevState.isOpen })), 0);
//
// ignore linting rule because following the recommended replacement caused behat failures
// eslint-disable-next-line react/no-access-state-in-setstate
window.setTimeout(() => this.setState({ isOpen: !this.state.isOpen }), 0);
}

render() {
Expand Down

0 comments on commit ee30f31

Please sign in to comment.