mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
refactor(search): use native binding for value prop
This commit is contained in:
parent
bc8903a67b
commit
417571b064
1 changed files with 2 additions and 8 deletions
|
@ -37,9 +37,6 @@
|
|||
/** Specify the value of the search input */
|
||||
export let value = "";
|
||||
|
||||
/** Specify the `type` attribute of the search input */
|
||||
export let type = "text";
|
||||
|
||||
/** Specify the `placeholder` attribute of the search input */
|
||||
export let placeholder = "Search...";
|
||||
|
||||
|
@ -125,6 +122,8 @@
|
|||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<input
|
||||
bind:this="{ref}"
|
||||
bind:value
|
||||
type="text"
|
||||
role="searchbox"
|
||||
class:bx--search-input="{true}"
|
||||
autofocus="{autofocus === true ? true : undefined}"
|
||||
|
@ -132,14 +131,9 @@
|
|||
disabled="{disabled}"
|
||||
id="{id}"
|
||||
placeholder="{placeholder}"
|
||||
type="{type}"
|
||||
value="{value}"
|
||||
{...$$restProps}
|
||||
on:change
|
||||
on:input
|
||||
on:input="{({ target }) => {
|
||||
value = target.value;
|
||||
}}"
|
||||
on:focus
|
||||
on:focus="{() => {
|
||||
if (expandable) expanded = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue