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

URLInput should use InputControl internally #64709

Closed
mirka opened this issue Aug 22, 2024 · 9 comments · Fixed by #65158
Closed

URLInput should use InputControl internally #64709

mirka opened this issue Aug 22, 2024 · 9 comments · Fixed by #65158
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@mirka
Copy link
Member

mirka commented Aug 22, 2024

What problem does this address?

The URLInput component uses an input element directly, instead of a standard component like InputControl or TextControl. This will cause styles to drift from the rest of the app, since it won't receive style updates with the rest of the componentry.

What is your proposed solution?

We should see if we can refactor this to use InputControl or TextControl. I think InputControl would be better because one of the consumers (LinkControl) has a submit button within the input field border that would be best to put in the suffix slot of InputControl.

URLPopover

URLPopover

LinkControl

LinkControl

Social Icons block

Social Icons block

@WordPress/gutenberg-design Do we also care to do some consolidation on how the submit button is placed? Especially the LinkControl and Social Icons block seem to have an unnecessary inconsistency.

@mirka mirka added [Type] Enhancement A suggestion for improvement. Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block editor /packages/block-editor labels Aug 22, 2024
@jasmussen
Copy link
Contributor

Do we also care to do some consolidation on how the submit button is placed? Especially the LinkControl and Social Icons block seem to have an unnecessary inconsistency.

Definitely care about consolidation. Social links should be the same as the LinkControl.

@rahulharpal1603
Copy link
Contributor

@mirka Can I take up this issue?

@mirka
Copy link
Member Author

mirka commented Sep 5, 2024

Of course, thank you! Please mention @WordPress/gutenberg-components in your PR when it's ready.

@rahulharpal1603
Copy link
Contributor

Thanks, this may take some time, is it ok? Because, I also have some college work to do

@rahulharpal1603
Copy link
Contributor

image

@mirka I replaced the <input> with <InputControl> but the problem is that the className prop, when applied to InputControl, it applies to the wrapper <div> instead of the <input> tag inside that wrapper <div>. This is causing the CSS to not apply properly on the input tag. This is due to some CSS property overriding the height property of the div class.

What to do? Please help, I am stuck here.

@rahulharpal1603
Copy link
Contributor

rahulharpal1603 commented Sep 9, 2024

image

See, the height of the <InputControl> element is smaller (36px) than the above element rendered with <TextControl>

@ciampo
Copy link
Contributor

ciampo commented Sep 9, 2024

@rahulharpal1603 we can definitely help! Could you open a PR with your changes, so that we can help with precise code comments and test the changes?

@rahulharpal1603
Copy link
Contributor

rahulharpal1603 commented Sep 9, 2024

@rahulharpal1603 we can definitely help! Could you open a PR with your changes, so that we can help with precise code comments and test the changes?

Sure

@rahulharpal1603
Copy link
Contributor

@ciampo, the height issue is fixed but there is some other issue, please check the above PR for more details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block editor /packages/block-editor [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants