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:
Eric Liu 2020-10-06 06:35:42 -07:00 committed by GitHub
commit 8412f7e744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -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;

View file

@ -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}"

View file

@ -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