-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix multiple file options showing up (#987) #988
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
Conversation
This change ensures that the file options composite widget is hidden if and only if none of its components is in focus. This is achieved by having a variable keep track of the state of the composite widget (in focus / not in focus).
Modified fix for processing#987 according to the requested changes. Moved isFocused to the components state and created a method for hadling the function calls executed in onBlur.
@@ -156,6 +168,8 @@ export class FileNode extends React.Component { | |||
ref={(element) => { this[`fileOptions-${this.props.id}`] = element; }} | |||
tabIndex="0" | |||
onClick={this.toggleFileOptions} | |||
onBlur={this.blurComponent} | |||
onFocus={() => { this.setState({ isFocused: true }); }} |
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.
could you move this into a function called onfocusComponent
?
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.
Definitely! I will fix this now.
@@ -156,6 +168,8 @@ export class FileNode extends React.Component { | |||
ref={(element) => { this[`fileOptions-${this.props.id}`] = element; }} | |||
tabIndex="0" | |||
onClick={this.toggleFileOptions} | |||
onBlur={this.blurComponent} |
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.
could you call this function onBlurComponent
rather than blurComponent
?
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.
Yes! Thank you for the feedback.
thanks for making the changes! i've asked for a couple more organizational things but this is looking great. |
Renamed method blurComponent to onBlurComponent. Moved duplicated code from onFocus callback to a new method called onFocusComponent.
this is working great for me. merging! |
This change ensures that the file options composite widget is
hidden if and only if none of its components is in focus. This
is achieved by having a variable keep track of the state of
the composite widget (in focus / not in focus).
I have verified that this pull request:
npm run lint
)Fixes #123