feat(UIShell): export ref for all UIShell components

This commit is contained in:
josefaidt 2020-10-01 15:13:40 -05:00
commit d1e9fc7225
11 changed files with 82 additions and 5 deletions

View file

@ -36,6 +36,12 @@
*/
export let platformName = undefined;
/**
* Obtain a reference to the HTML button element
* @type {null | HTMLButtonElement} [ref=null]
*/
export let ref = null;
import HamburgerMenu from "../SideNav/HamburgerMenu.svelte";
let winWidth = undefined;
@ -53,7 +59,13 @@
{#if winWidth < 1056}
<HamburgerMenu bind:isOpen="{isSideNavOpen}" />
{/if}
<a href="{href}" class:bx--header__name="{true}" {...$$restProps} on:click>
<a
href="{href}"
class:bx--header__name="{true}"
bind:this="{ref}"
{...$$restProps}
on:click
>
{#if company}
<span class:bx--header__name--prefix="{true}">{company}&nbsp;</span>
{/if}