-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixes #150. #151
Fixes #150. #151
Conversation
1ca2dbe
to
75198c6
Compare
And…I haven't the slightest idea why those tests are failing. They fail locally (forgot to look earlier…oops!), but they are also failing on |
@dahjelle - Thanks for fixing this! I'll take a look at the master failure in a bit. |
@@ -111,7 +111,10 @@ export class ExecuteButton extends React.Component { | |||
} else { | |||
document.removeEventListener('mouseup', onMouseUp); | |||
onMouseUp = null; | |||
this.setState({ optionsOpen: false }); | |||
// don't run setState if we click on an <li> menu item | |||
if (upEvent.target.parentNode.parentNode !== downTarget.parentNode) { |
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.
A small nit, but upEvent.target.parentNode.parentNode
could be named into something more readable
75198c6
to
6dd3553
Compare
I tried a different tactic using |
@@ -111,7 +111,13 @@ export class ExecuteButton extends React.Component { | |||
} else { | |||
document.removeEventListener('mouseup', onMouseUp); | |||
onMouseUp = null; | |||
this.setState({ optionsOpen: false }); | |||
// don't run setState if we click on the menu | |||
if (!( |
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:
const isOptionsMenuClicked = !(
downTarget.parentNode.compareDocumentPosition(upEvent.target) &
Node.DOCUMENT_POSITION_CONTAINED_BY
);
if (isOptionsMenuClicked) {
?
So the build fails on |
6dd3553
to
c8aa3b7
Compare
c8aa3b7
to
e55e4ac
Compare
Thank you for the hand-holding! Glad to help. :-D
Yes, I like it. Thanks! I moved the
It looks like For whatever it's worth, I found this page where they had a suggestion to add a mocked
to |
omg that's exactly what we needed - |
e55e4ac
to
9cfb3a4
Compare
Cool! I rebased this PR on master. :-D |
…transform-es2015-block-scoping-6.24.1 Update babel-plugin-transform-es2015-block-scoping to the latest version 🚀
* edit commands * 0.2.3 * add renovate
Since the
<li>
'sonMouseUp
handler will setoptionsOpen
to false, we don't need to do that here if we click on the<li>
. Fixes #150.