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
Document and rename showSuggestionsOverride to something more sensible #16497
Conversation
|
||
When hiding the URLInput using CSS (as is sometimes done for accessibility purposes), the suggestions can still be displayed. This is because they're rendered in a popover in a different part of the DOM, so any styles applied to the URLInput's container won't affect the popover. | ||
|
||
This prop allows the suggestions list to be progrmatically not rendered by passing a boolean—it can be `true` to make sure suggestions aren't rendered, or `false`/`undefined` to fall back to the default behaviour of showing suggestions when matching autocompletion items are found. |
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.
progrmatically -> programmatically
@@ -223,9 +223,9 @@ class URLInput extends Component { | |||
this.inputRef.current.focus(); | |||
} | |||
|
|||
static getDerivedStateFromProps( { showSuggestionsOverride }, { showSuggestions } ) { |
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.
Aren't we breaking back compatibility with current usages of showSuggestionsOverride? Should we keep supporting the existing prop but write a deprecated warning when it is used?
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.
It was added in #10128 (merged 16 hours ago) so I think we don't break anything.
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.
Thanks! 👍
Description
I added a small contribution to #10128 to fix a problem when hiding the URLInput. It was pointed out in review comments that the name of the prop could be improved, and documentation should be added.
Now that #10128 has been merged, here's the follow up addressing those comments.
How has this been tested?
Expected behaviour
The input is hidden due to the button block no longer being selected. The autocomplete suggestions are also hidden.
Screenshots
Types of changes
Code quality improvement (non-breaking change which fixes an issue)
Checklist: