mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
fix(slider): use CSS to hide input if hideTextInput is true
This commit is contained in:
parent
924de3a49e
commit
5c14cde605
1 changed files with 22 additions and 16 deletions
|
@ -191,21 +191,27 @@
|
|||
/>
|
||||
</div>
|
||||
<span class:bx--slider__range-label="{true}">{maxLabel || max}</span>
|
||||
{#if !hideTextInput}
|
||||
<input
|
||||
type="{inputType}"
|
||||
type="{hideTextInput ? 'hidden' : inputType}"
|
||||
style="{hideTextInput ? 'display: none' : undefined}"
|
||||
id="input-{id}"
|
||||
aria-label="{$$props['aria-label'] || 'Slider number input'}"
|
||||
name="{name}"
|
||||
class:bx--text-input="{true}"
|
||||
class:bx--slider-text-input="{true}"
|
||||
class:bx--text-input--light="{light}"
|
||||
class:bx--text-input--invalid="{invalid}"
|
||||
value="{value}"
|
||||
aria-label="{$$props['aria-label'] || 'Slider number input'}"
|
||||
disabled="{disabled}"
|
||||
required="{required}"
|
||||
min="{min}"
|
||||
max="{max}"
|
||||
step="{step}"
|
||||
on:change="{({ target }) => {
|
||||
value = Number(target.value);
|
||||
}}"
|
||||
disabled="{disabled}"
|
||||
value="{value}"
|
||||
data-invalid="{invalid || null}"
|
||||
aria-invalid="{invalid || null}"
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue