filament icon indicating copy to clipboard operation
filament copied to clipboard

Feature: Move affixes

Open thethunderturner opened this issue 10 months ago • 3 comments

Description

Closes #14873

This seems like the simplest way to "move" the affixes. When clicking on a prefix/suffix, find the nearest container container with ".fi-input-wrp", and focus on the input. Let me know if you think there is a simpler way.

Visual changes

none

Functional changes

  • [x] Code style has been fixed by running the composer cs command.
  • [x] Changes have been tested to not break existing functionality.
  • [x] Documentation is up-to-date.

thethunderturner avatar Feb 26 '25 20:02 thethunderturner

For clarity, this only works with TextInput. Do we need this to work with other components as well? For example, Select and ColorInput? If so, when it focuses, do we want the dropdown to open (for Select) and the popup to select color (for ColorPicker)? Then I have to change my approach.

thethunderturner avatar Feb 26 '25 22:02 thethunderturner

I think Zep might mean that the input size actually increases and the affixes become click-through, so this will likely depend on his review

danharrin avatar Feb 27 '25 08:02 danharrin

I think Zep might mean that the input size actually increases and the affixes become click-through, so this will likely depend on his review

Yes that's exactly what I meant, though then we might have to calculate the input size (padding to account for affixes) dynamically based on the affix size.

I think the current approach in this PR also has issues when used with affix actions? When action click events bubble up and aren't stopped, they will trigger focus on the input element.

zepfietje avatar Apr 18 '25 06:04 zepfietje

Hi, I am closing this as I think it is quite far away from what Zep was looking for in the original issue

danharrin avatar Jun 02 '25 12:06 danharrin