mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
Merge pull request #303 from weaseldotro/master
add ref to ListBoxMenu, add id to RadioButtonGroup container div, fix light prop for ComboBox input
This commit is contained in:
commit
8412f7e744
3 changed files with 15 additions and 0 deletions
|
@ -222,6 +222,7 @@
|
|||
aria-controls="{open ? menuId : undefined}"
|
||||
aria-owns="{open ? menuId : undefined}"
|
||||
class:bx--text-input="{true}"
|
||||
class:bx--text-input--light="{light}"
|
||||
class:bx--text-input--empty="{inputValue === ''}"
|
||||
on:input="{({ target }) => {
|
||||
inputValue = target.value;
|
||||
|
|
|
@ -4,9 +4,16 @@
|
|||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
|
||||
/**
|
||||
* Obtain a reference to the input HTML element
|
||||
* @type {null | HTMLDivElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
</script>
|
||||
|
||||
<div
|
||||
bind:this={ref}
|
||||
role="listbox"
|
||||
id="menu-{id}"
|
||||
class:bx--list-box__menu="{true}"
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
*/
|
||||
export let orientation = "horizontal";
|
||||
|
||||
/**
|
||||
* Set an id for the container div element
|
||||
* @type {string} [id]
|
||||
*/
|
||||
export let id
|
||||
|
||||
import { createEventDispatcher, setContext } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
|
||||
|
@ -46,6 +52,7 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
{id}
|
||||
class:bx--form-item="{true}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue