Document and rename showSuggestionsOverride to something more sensible#16497
Merged
noisysocks merged 2 commits intomasterfrom Jul 11, 2019
Merged
Document and rename showSuggestionsOverride to something more sensible#16497noisysocks merged 2 commits intomasterfrom
noisysocks merged 2 commits intomasterfrom
Conversation
4 tasks
|
|
||
| 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. |
Member
There was a problem hiding this comment.
progrmatically -> programmatically
| this.inputRef.current.focus(); | ||
| } | ||
|
|
||
| static getDerivedStateFromProps( { showSuggestionsOverride }, { showSuggestions } ) { |
Member
There was a problem hiding this comment.
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?
Member
There was a problem hiding this comment.
It was added in #10128 (merged 16 hours ago) so I think we don't break anything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: