Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
279 stars 77 forks source link

bug(`@vtmn/css`): The placeholder a cropped on the VtmnSearch #1434

Closed Tlahey closed 1 year ago

Tlahey commented 1 year ago

image

The input have a padding for the clean icon. But due to this padding, the placeholder is shifted too. We can fixed this issue by using :placeholder-shown and apply the padding only if input:not(:placeholder-shown)

https://developer.mozilla.org/en-US/docs/Web/CSS/:placeholder-shown

Edit:

The padding can be computed properly by used the css property :has in order to check if the showSearchButton element is visible. But :has is not supported by all browser. So the solution is to applied a background color on the vtmn-search_buttons and reduce the padding-inline-end to match the same as padding-inline-start

Edit 12/06 :

The second solution with a background-color is not possible, when we use it with a disabled input, the white color stay on the input.

image

:has property is not possible because the input is not a parent of the vtmn-search_buttons

image