forked from jachin/much-select-elm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the
focus()
function to MuchSelect
.
Add an example that shows how to call `focus()`, which will focus the `<much-select>`.
- Loading branch information
Jachin Rupe
committed
Dec 11, 2023
1 parent
a28a7d2
commit 7da199d
Showing
6 changed files
with
68 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div id="focus-on-demand"> | ||
<h3>Single Select - <code>blurOrUnfocusedValueChanged</code> Event</h3> | ||
<much-select> | ||
<select slot="select-input"> | ||
<option value="111">Grass Pea</option> | ||
<option value="222">Velvet Bean</option> | ||
<option value="333">Sword Bean</option> | ||
<option value="444">Soybean</option> | ||
</select> | ||
</much-select> | ||
<br> | ||
<button>Focus 👀</button> | ||
|
||
<script> | ||
window.addEventListener("load", () => { | ||
document | ||
.querySelector("#focus-on-demand button") | ||
.addEventListener("click", () => { | ||
document.querySelector("#focus-on-demand much-select").focus(); | ||
}); | ||
}); | ||
</script> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters