-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat hide clear button #174
Conversation
🦋 Changeset detectedLatest commit: 7b3ed15 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
0212728
to
45a761f
Compare
eede680
to
64cc54f
Compare
64cc54f
to
a33d92f
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.
I have some minor remarks. I think we should set show_clear_button
to true as a default for text inputs in the SubHeaders. Wdyt?
585fce7
to
06ca3d9
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.
Good to merge once the CI is green
What are you trying to accomplish?
Introduce a functionality to show and hide the clear button of the SubHeader component filter input. The clear button is shown when the filter input has some value typed in, and it is hidden when the input is empty.
Integration
No required, when the
show_clear_button: true
argument is passed to thecomponent.with_filter_input
, the added functionality will work automatically.List the issues that this change affects.
https://community.openproject.org/projects/openproject/work_packages/57777/activity
Risk Assessment
What approach did you choose and why?
Added a new method
toggleFilterInputClearButton
to theSubHeaderElement
which will decide whether the clear button should be displayed or not. This method is then triggered on the filter inputfocus
andinput
events, ensuring that the clear button is shown only when there is content inside the input field.Anything you want to highlight for special attention from reviewers?
Would be nice to have the
PrimerTextFieldElement#clearContents
method updated to emit an input event. That way thetoggleFilterInputClearButton
shouldn't be bound to both thefocus
and theinput
event, just the latter. This has been an issue for another functionality before, so I might need to make that change PR against the main primer repo, not this one.Merge checklist