-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[URLInput] Customizable control rendering #24115
Merged
Merged
Conversation
This file contains 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
…f controls possible (and easy)
Size Change: +129 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
adamziel
changed the title
Update/url input based on input control
[URLInput] Make the control rendering customizable
Jul 22, 2020
adamziel
requested review from
shaunandrews,
tellthemachines,
youknowriad and
draganescu
July 22, 2020 12:22
adamziel
added
[Block] Navigation
Affects the Navigation Block
[Feature] List View
Menu item in the top toolbar to select blocks from a list of links.
[Feature] Link Editing
Link components (LinkControl, URLInput) and integrations (RichText link formatting)
[Feature] Navigation Screen
labels
Jul 22, 2020
draganescu
approved these changes
Jul 22, 2020
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 tested locally and nothing seems to break. It also looks like the simplest path ahead right now.
adamziel
changed the title
[URLInput] Make the control rendering customizable
[URLInput] Customizable control rendering
Jul 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Block] Navigation
Affects the Navigation Block
[Feature] Link Editing
Link components (LinkControl, URLInput) and integrations (RichText link formatting)
[Feature] List View
Menu item in the top toolbar to select blocks from a list of links.
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
URLInput makes it possible to customize how suggestions are rendered via
__experimentalRenderSuggestions
. Unfortunately, it assumes that the general structure of the component is more or less as follows:This works for some use cases, but doesn't serve the in-toolbar editing () very well, where the following structure would be preferred:
(Note that
aria-activedescendant
allows this change in structure as long as validaria-owns
is present)This PR closes this gap by adding an
__experimentalRenderControl
prop. Let's take a look at quick&dirty example of usage:And a result:
How has this been tested?
This PR is not supposed to change any behavior. To test it, simply walk through a few places where the URLInput is used (a full list available at #24089) and confirm they work the same before and after applying this PR.
Alternatives considered
At this point it seems like the control and suggestions could become two separate components. Alternatively, their respective logic could be extracted into hooks. The scope of such changes would be large and the usefulness very limited at this time so I decided to update the
URLInput
component as it is.Types of changes
Non-breaking changes
Checklist: