Skip to content

Commit

Permalink
Initiate Combobox input value with root default value (#104)
Browse files Browse the repository at this point in the history
* fix(combobox): initiate input value with default value, if supplied

* ci(changesets): add changeset
  • Loading branch information
coopbri authored Jul 29, 2024
1 parent 5135105 commit 273ffb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/witty-mice-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@omnidev/sigil": patch
---

Initiate `Combobox` input value with `Combobox` root default value, if supplied
2 changes: 1 addition & 1 deletion src/components/core/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const Combobox = ({
...rest
}: ComboboxProps) => {
const [filteredItems, setFilteredItems] = useState(items),
[inputValue, setInputValue] = useState("");
[inputValue, setInputValue] = useState(rest.defaultValue || "");

/**
* Handle input value change. Composes a custom `onInputValueChange` handler, if provided.
Expand Down

0 comments on commit 273ffb2

Please sign in to comment.