Skip to content

Comments

fix(components): Adjust Clearable Positioning#2925

Open
ZakaryH wants to merge 1 commit intomasterfrom
adjust-clearable-position-logic
Open

fix(components): Adjust Clearable Positioning#2925
ZakaryH wants to merge 1 commit intomasterfrom
adjust-clearable-position-logic

Conversation

@ZakaryH
Copy link
Contributor

@ZakaryH ZakaryH commented Feb 23, 2026

Motivations

while trying to implement Clearable on AutocompleteRebuilt, I was encountering an issue where the clearable button is not centered. even if I apply something to try to give the parent a relative, flex, attribute - the transform still gets in the way.

I don't believe the transform is necessary. we have a container that becomes the height of the input - why not let it center itself?

the only case I can immediately think of that might have unexpected results is a multiline inputText, however we don't currently support clearable on multiline inputs so that's not an issue. interestingly I think we'll encounter the same "problem" that has on the Autocomplete I'm making but to be honest I'm not sure it's that bad to have the button still be centered.

MUI does the exact same thing

image

Changes

Added

Changed

functionally it should be identical. hopefully the visual tests confirm that.

all that is different is now we center the button with a more flexible mechanism rather than the transform: 50% which doesn't always work and is a bit more complicated than align-items: center

Deprecated

Removed

Fixed

Security

Testing

Changes can be
tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

@cloudflare-workers-and-pages
Copy link

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00debe5
Status: ✅  Deploy successful!
Preview URL: https://1cd766ac.atlantis.pages.dev
Branch Preview URL: https://adjust-clearable-position-lo.atlantis.pages.dev

View logs

@ZakaryH
Copy link
Contributor Author

ZakaryH commented Feb 23, 2026

something else I've thought about while looking into this is why do we have each instance of handleClear focusing the input? why wouldn't we make that a responsibility of ClearAction?

if you have a value, and you press clear to remove it or all values, then the clear button goes away since there's nothing to clear. because the element that just had focus is gone, focus has to go somewhere. the most sensible place would be the input associated with the clear button.

@ZakaryH
Copy link
Contributor Author

ZakaryH commented Feb 24, 2026

@jdeichert this is the PR that should go into master first

@ZakaryH ZakaryH marked this pull request as ready for review February 24, 2026 17:20
@ZakaryH ZakaryH requested a review from a team as a code owner February 24, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant