mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
Merge pull request #237 from kamil-murtaza/#236-Text-Input-Required
Fix missing required attribute on TextInput.
This commit is contained in:
commit
c209df084a
1 changed files with 7 additions and 0 deletions
|
@ -83,6 +83,12 @@
|
|||
*/
|
||||
export let ref = null;
|
||||
|
||||
/**
|
||||
* Set to `true` to mark the field as required
|
||||
* @type {boolean} [required=false]
|
||||
*/
|
||||
export let required = false;
|
||||
|
||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||
|
||||
$: errorId = `error-${id}`;
|
||||
|
@ -129,6 +135,7 @@
|
|||
{placeholder}
|
||||
{type}
|
||||
{value}
|
||||
{required}
|
||||
class:bx--text-input={true}
|
||||
class:bx--text-input--light={light}
|
||||
class:bx--text-input--invalid={invalid}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue