mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
feat(combo-box): add hideLabel
prop (#2153)
This commit is contained in:
parent
7754ea3691
commit
436dea47e8
7 changed files with 50 additions and 1 deletions
|
@ -46,6 +46,9 @@
|
|||
/** Specify the title text of the combobox */
|
||||
export let titleText = "";
|
||||
|
||||
/** Set to `true` to visually hide the label text */
|
||||
export let hideLabel = false;
|
||||
|
||||
/** Specify the placeholder text */
|
||||
export let placeholder = "";
|
||||
|
||||
|
@ -226,7 +229,12 @@
|
|||
|
||||
<div class:bx--list-box__wrapper={true}>
|
||||
{#if titleText || $$slots.titleText}
|
||||
<label for={id} class:bx--label={true} class:bx--label--disabled={disabled}>
|
||||
<label
|
||||
for={id}
|
||||
class:bx--label={true}
|
||||
class:bx--label--disabled={disabled}
|
||||
class:bx--visually-hidden={hideLabel}
|
||||
>
|
||||
<slot name="titleText">
|
||||
{titleText}
|
||||
</slot>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue