-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Core] Remove click-awayable mixin #3360
Conversation
I like this solution 👍. I can't see better way to do it.
|
Sounds good, I'll continue to pursue this.
What do you think is the best way to do this? Add a
I wondered the same thing. My initial reaction was that |
I think that it's simpler to put the logic inside the Indeed, |
ddad25a
to
5a4e55b
Compare
|
@@ -0,0 +1,48 @@ | |||
/*eslint-disable */ |
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.
Still need to remove this...
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.
I guess we need to add the PropTypes
@oliviertassinari @alitaheri This is almost done. The only way I can currently think of fixing the tbody issue is to not use react-event-listener and just manually bind the events in The other approach is if |
I think the |
@newoga I was thinking the same. Until I realized that http://jedwatson.github.io/react-select/ is using |
I think this is indeed better 👍 |
/> | ||
); | ||
|
||
return React.createElement(type, other, listener, children); |
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.
What about rendering the children
before the listener
?
@newoga That looks good so far. We are close to merging this 👍. |
Sounds good, I'm going to take another stab at this tonight and hopefully we'll be able to finish it. After this, there is only one component that is using the style-resizable mixin we'll need to take care of. 😄 |
538da4c
to
9811cda
Compare
@alitaheri @oliviertassinari Can you look at this revised implementation? I couldn't see a way around the Thanks! |
...other, | ||
} = this.props; | ||
|
||
return React.createElement(type, other, children); |
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.
How about rendering children directly? const el = ReactDOM.findDOMNode(this);
would work anyway. This component no longer needs to render anything extra, it will be like a wrapper that finds it's first node and attached the click away to it. I think it's best to remove type
:
return children;
And then render any dom element that we wish to attach it to as the child?
This is not tested, I don't know if it will work or not. just thinking out load 😅
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.
Mm, that might work (not before though when we were using the react-event-listener). Though we'd have to go through each of the components to add the appropriate type as a child of the ClickAwayListener.
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.
If don't have the time I can take it from here. I have a lot of time today 😁 😎
I think it's time you take some rest anyway O.o You've done great 👍
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.
One sec, I'm trying it now. If it needs more fixes after feel free to pursue! Thanks!
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.
Sure, Thanks a lot 👍 I'll take it from where ever you leave off 😄
9811cda
to
2dfef4e
Compare
@alitaheri Returning Thanks @alitaheri! 😁 |
Well I didn't expect you do it all O.O Thank yo so much @newoga This is beautiful 😍 The implementation is awesome 👍 All green here 👍 😄 @oliviertassinari Feel free to merge if all's good. |
[Core] Remove click-awayable mixin
@newoga Really nice work 👍. |
This fixes a regression that was introduced in mui#3360. The previous `click-awayable` mixin listened on `mouseup` and `touchend` events and the new `ClickAwayListener` was implemented to use `mousedown` and `touchstart` events. This commit changes the events to mimick the behavior from the original mixin. Resolves mui#3818
This fixes a regression that was introduced in mui#3360. The previous `click-awayable` mixin listened on `mouseup` and `touchend` events and the new `ClickAwayListener` was implemented to use `mousedown` and `touchstart` events. This commit changes the events to mimick the behavior from the original mixin. Resolves mui#3818
This fixes a regression that was introduced in mui#3360. The previous `click-awayable` mixin listened on `mouseup` and `touchend` events and the new `ClickAwayListener` was implemented to use `mousedown` and `touchstart` events. This commit changes the events to mimick the behavior from the original mixin. Resolves mui#3818
This fixes a regression that was introduced in mui#3360. The previous `click-awayable` mixin listened on `mouseup` and `touchend` events and the new `ClickAwayListener` was implemented to use `mousedown` and `touchstart` events. This commit changes the events to mimick the behavior from the original mixin. Resolves mui#3818
Related to #2437
Let me know if we should deprecate instead of remove.
Done:
mixins/click-awayable.js
and references inindex.js
Outstanding:
<noscript/>
in<tbody/>