mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
Add required
prop to Select. (#968)
Upgrade sveld to set paths correctly on Windows. Make Prettier script compatible with Windows and run it.
This commit is contained in:
parent
26db657868
commit
6458c97c1a
14 changed files with 49 additions and 48 deletions
|
@ -60,6 +60,9 @@
|
|||
/** Obtain a reference to the select HTML element */
|
||||
export let ref = null;
|
||||
|
||||
/** Set to `true` to mark the field as required */
|
||||
export let required = false;
|
||||
|
||||
import { createEventDispatcher, setContext, afterUpdate } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
import ChevronDown16 from "../icons/ChevronDown16.svelte";
|
||||
|
@ -112,6 +115,7 @@
|
|||
aria-describedby="{invalid ? errorId : undefined}"
|
||||
aria-invalid="{invalid || undefined}"
|
||||
disabled="{disabled || undefined}"
|
||||
required="{required || undefined}"
|
||||
id="{id}"
|
||||
name="{name}"
|
||||
class:bx--select-input="{true}"
|
||||
|
@ -156,6 +160,7 @@
|
|||
name="{name}"
|
||||
aria-describedby="{invalid ? errorId : undefined}"
|
||||
disabled="{disabled || undefined}"
|
||||
required="{required || undefined}"
|
||||
aria-invalid="{invalid || undefined}"
|
||||
class:bx--select-input="{true}"
|
||||
class="{size && `bx--select-input--${size}`}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue