-
Notifications
You must be signed in to change notification settings - Fork 23
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
Convert UserEdit to functional #571
Convert UserEdit to functional #571
Conversation
a03b0e0
to
179823e
Compare
f9a7fa6
to
8d53f2e
Compare
Change to FormSelect for Project selection
8d53f2e
to
eb3c3aa
Compare
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.
Generally looks good, I left couple suggestions
this.setState({ | ||
filteredProjects: newSelectOptions, | ||
}); | ||
if (!isProjectsOpen){ |
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.
We don't need to have it in useEffect as MenuToggle handles it
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.
that's what I thought too, and I removed it, but the behavior wasn't right.
This pattern actually comes from the PF5 react example for multiselect typeahead with chips:
https://v5-archive.patternfly.org/components/menus/select#multiple-typeahead-with-chips
|
||
render () { | ||
const { projects, inputValue, filteredProjects, user, userProjects } = this.state; | ||
}, [inputValue, projects, isProjectsOpen]); |
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.
isProjectsOpen
can be removed from dependencies
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.
Only if I remove forcing it open when there is an input value present. ;)
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.
@mshriver oh I see, some specifics because of typeahead, then ignore my comments
Tested well locally, field aren't validated in master right now and that would be a good follow up.
Also this could just be a modal instead of a separate page and route, with the ID as a prop.