Rich HTML (slot) for sl-input
placeholder
#1627
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
This won't be as simple as I was hoping, because we're passing the placeholder through to the I'd classify this as a "nice to have" but unlikely to be something we'll get to anytime soon due to the cost/benefit of making this work for all affected form controls. We'd probably have to add slot detection and a faux placeholder and juggle between using native text placeholder and the custom HTML/faux placeholder. I'd be open to a PR if someone wants to take a stab at a PR, but I suspect the amount of code and complexity to achieve this will be more than we want to maintain. |
Beta Was this translation helpful? Give feedback.
-
Currently,
SlInput.placeholder
only supports astring
value due to it being assigned directly to theHTMLInputElement.placeholder
attribute.However consider a scenario when you want rich HTML, for example a search field with a styled
<span><kbd>/</kbd>Search…</span>
placeholder.This would require a "placeholder" slot in the
sl-input
, and ofcourse some non-native way of rendering a slotted HTML element as a placeholder.Beta Was this translation helpful? Give feedback.
All reactions