Skip to content
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

Why is the horizontal width fixed at 300 pixels in URLInput? #13474

Closed
kmix-39 opened this issue Jan 24, 2019 · 9 comments
Closed

Why is the horizontal width fixed at 300 pixels in URLInput? #13474

kmix-39 opened this issue Jan 24, 2019 · 9 comments
Labels
Needs Dev Ready for, and needs developer efforts [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@kmix-39
Copy link

kmix-39 commented Jan 24, 2019

The element of URLInput protrudes in the InspectorControls.

packages/editor/src/components/url-input/style.scss
$input-size: 300px;

Why is the horizontal width fixed at 300 pixels in URLInput?
Is it useless in auto?

@melvinkoopmans
Copy link

When you use the URLInput in the inspector controls this will cause it to become wider than the container.
screenshot 2019-01-24 at 11 59 18

@swissspidy swissspidy added [Type] Bug An existing feature does not function as intended Needs Design Feedback Needs general design feedback. [Package] Components /packages/components labels Feb 15, 2019
@karmatosed
Copy link
Member

In order for it to not overlap a setting has to be made. If a solution can be found that avoids that but still doesn't have overlap, that would be great.

@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Feb 18, 2019
@smoothie
Copy link

Any updates on this?

@karmatosed
Copy link
Member

Hi @ieim there aren't, however, let me loop a keyword on this to try and get it fixed.

@karmatosed karmatosed added the Needs Dev Ready for, and needs developer efforts label Jan 17, 2020
@aduth
Copy link
Member

aduth commented Jan 21, 2020

This should probably be resolved as part of the ongoing refactoring of LinkControl component (#19523, #18061). The current implementation of URLInput seems to have been optimized as assuming to be rendered for use in applying a link in a paragraph, and isn't as reusable as one would want. A default or maximum width might be expected to be applied in these contexts (the link dialog), but the underlying URLInput shouldn't be very opinionated about this.

In the meantime, you might have success in overriding (or unsetting) the width values assigned to the selectors in this stylesheet:

In order for it to not overlap a setting has to be made

@karmatosed It's not clear to me: What did you have in mind as being overlapped?

@talldan
Copy link
Contributor

talldan commented Feb 18, 2020

There's an isFullWidth prop that sets the width to 100%.

I remember looking into the reason for the hard-coded width a while back as it was also causing the same issue for me. The reason is that the suggestion list that appears underneath the input also has that width. Usually responsibility would be on some parent component of URLInput to constrain its width, but because the suggestions are rendered in a popover elsewhere in the DOM they can't be constrained.

@aduth
Copy link
Member

aduth commented Feb 25, 2020

Usually responsibility would be on some parent component of URLInput to constrain its width, but because the suggestions are rendered in a popover elsewhere in the DOM they can't be constrained.

That's a good observation to raise, and I see the challenge. It still seems technically possible to accommodate for this, e.g. using measurements (element.scrollWidth) of the input rendered within the parent container to assign as an explicit width of the suggestions popover content. It becomes a bit more complicated when you consider elements that resize in a fluid-width parent. There's some precedent here with react-resize-aware (#18745) and a Gutenberg abstraction (#19918) that we could lean on for this.

But, per my comment at #18061 (comment), it might not be something worth spending too much effort on, considering if we want to...

Move LinkControl's custom suggestions rendering into URLInput

...where if LinkControl's suggestion rendering becomes the new default for URLInput, then it would no longer be as part of a popup.

@paaljoachim
Copy link
Contributor

Hi @kmix-39 and others is this issue still valid?
If so how do we move forward with it?

@kmix-39
Copy link
Author

kmix-39 commented Feb 25, 2021

Hi @paaljoachim.
sorry. I've confirmed that this issue has been resolved and I close the issue.

@kmix-39 kmix-39 closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Dev Ready for, and needs developer efforts [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

8 participants