-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added reaction on disableOnClickOutside property change #318
Added reaction on disableOnClickOutside property change #318
Conversation
bump on this getting merged. i'm currently having to do a work around for the issue this addresses |
src/index.js
Outdated
if (this.props.disableOnClickOutside) return; | ||
this.enableOnClickOutside(); | ||
} | ||
|
||
componentDidUpdate() { | ||
componentDidUpdate({ disableOnClickOutside: prevDisableOnClickOutside }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break on IE11. As much as I want to burn IE to the ground, for now this code still has to live in a previous era of JS. We'll have to cache that value the older way.
componentDidUpdate({ disableOnClickOutside: prevDisableOnClickOutside }) { | |
componentDidUpdate(prevProps) { | |
var prevDisableOnClickOutside = prevProps.disableOnClickOutside; |
src/index.js
Outdated
if (this.props.disableOnClickOutside) return; | ||
this.enableOnClickOutside(); | ||
} | ||
|
||
componentDidUpdate() { | ||
componentDidUpdate({ disableOnClickOutside: prevDisableOnClickOutside }) { | ||
const { disableOnClickOutside } = this.props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'll break on this, too.
const { disableOnClickOutside } = this.props; | |
var disableOnClickOutside = this.props.disableOnClickOutside; |
This will need a rebase, but mostly because v6.9.0 was released in the mean time, which introduced just enough code to require manual code selection. |
8f7320f
to
db972dc
Compare
Sorry for the delay. PR Updated |
please merge |
+1 on getting this merged. |
why closed? |
Because time moved on and React completely changed how things are "supposed to be done". Modern React is based on hooks, and https://github.com/Pomax/react-onclickoutside#functional-component-with-usestate-hook explains how to do what this HoC achieved for older versions of React. |
Added reaction on
disableOnClickOutside
property change. Activates onfalse
, deactivates ontrue
.Currently this property affects activation only on component’s mount phase
Fix for #317