Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@daun
Copy link
Contributor

@daun daun commented Nov 14, 2025

Been working on a custom listing UI and noticed that appended icons current don't work for the Input component. They end up in the same position as the prepended icons, overlaid over each other. The solution is splitting out the prepended and appended icon classes as these shouldn't be applied to both icon slots equally.

Example

<Input icon="search" placeholder="Search..." clearable="true" />

Before

Screenshot 2025-11-14 at 14 11 56

After

Screenshot 2025-11-14 at 14 03 50

Note

Split icon class logic into separate prepended/appended variants and update template bindings to correctly position input icons.

  • UI Input (packages/ui/src/Input/Input.vue)
    • Icon classes:
      • Remove position-specific compound variants from iconClasses and keep only shared styling.
      • Add prependedIconClasses (start-0 with size-based padding) and appendedIconClasses (end-0 with size-based padding).
    • Template:
      • Use prependedIconClasses for the prepend slot and appendedIconClasses for the append slot to position icons correctly.

Written by Cursor Bugbot for commit d59924b. This will update automatically on new commits. Configure here.

@jackmcdade
Copy link
Member

Default icons are the prepended icons. They're the same. It's default/prepend vs appended.

@jackmcdade jackmcdade reopened this Nov 14, 2025
@jackmcdade
Copy link
Member

Sorry I may have misspoke. Gimme a chance for another look.

@jasonvarga
Copy link
Member

You can see the issue more clearly yourself by doing this on the master branch:

@jackmcdade jackmcdade merged commit f32be14 into statamic:master Nov 14, 2025
40 checks passed
@jackmcdade
Copy link
Member

jackmcdade commented Nov 14, 2025

Apologies for rushing the review earlier, this is a lovely, elegant solution to a problem I didn't realize we had. Thank you @daun!

@daun daun deleted the fix/input-icon-classes branch November 15, 2025 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants