[URLInput] Customizable control rendering #24115
Merged
Conversation
…f controls possible (and easy)
|
Size Change: +129 B (0%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
draganescu
approved these changes
Jul 22, 2020
Contributor
draganescu
left a comment
There was a problem hiding this comment.
I tested locally and nothing seems to break. It also looks like the simplest path ahead right now.
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
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-activedescendantallows this change in structure as long as validaria-ownsis present)This PR closes this gap by adding an
__experimentalRenderControlprop. 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
URLInputcomponent as it is.Types of changes
Non-breaking changes
Checklist: