Skip to content

Cannot get smartSelectInstance from Link component #3954

@AydanGaite

Description

@AydanGaite
  • Framework7 version: 6.3.1
  • Svelte version: 3.37.0
  • Platform and Target: Chrome Version 95.0.4638.54 (Official Build) (arm64)

Describe the bug

I cannot call smartSelectInstance from the Link component, as it is undefined.

To Reproduce

<script lang="ts">
let ref;
let smartSelectInstance;

onMount(() => {
  // *This throws an error
  smartSelectInstance = ref.smartSelectInstance();
});
</script>

<Link
  smartSelect
  smartSelectParams="{{
    openIn: 'popover',
    closeOnSelect: true,
  }}"
  bind:this="{ref}"
>
   Select
   <select>
      <option>Test</option>
   </select>
</Link>

Expected behavior

I should get the smart select instance from the Link instance

Additional context

This is what the Link component looks like when it is initialized. There is no smartSelectInstance to call.

$$: {fragment: {}, ctx: Array(29), props: {}, update: ƒ, not_equal: ƒ,}
$destroy: () => { destroyComponent() onDestroy() }
$on: ƒ (...args)
$set: ƒ (...args)
$$set: (...)
badge: (...)
badgeColor: (...)
class: (...)
href: (...)
iconOnly: (...)
noLinkClass: (...)
routeProps: (...)
smartSelect: (...)
smartSelectParams: (...)
tabLink: (...)
tabLinkActive: (...)
tabbarLabel: (...)
target: (...)
text: (...)
tooltip: (...)
tooltipTrigger: (...)
get $$set: ƒ get()
get badge: ƒ get()
set badge: ƒ set(value)
get badgeColor: ƒ get()
set badgeColor: ƒ set(value)
get class: ƒ get()
set class: ƒ set(value)
get href: ƒ get()
set href: ƒ set(value)
get iconOnly: ƒ get()
set iconOnly: ƒ set(value)
get noLinkClass: ƒ get()
set noLinkClass: ƒ set(value)
get routeProps: ƒ get()
set routeProps: ƒ set(value)
get smartSelect: ƒ get()
set smartSelect: ƒ set(value)
get smartSelectParams: ƒ get()
set smartSelectParams: ƒ set(value)
get tabLink: ƒ get()
set tabLink: ƒ set(value)
get tabLinkActive: ƒ get()
set tabLinkActive: ƒ set(value)
get tabbarLabel: ƒ get()
set tabbarLabel: ƒ set(value)
get target: ƒ get()
set target: ƒ set(value)
get text: ƒ get()
set text: ƒ set(value)
get tooltip: ƒ get()
set tooltip: ƒ set(value)
get tooltipTrigger: ƒ get()
set tooltipTrigger: ƒ set(value)
[[Prototype]]: ProxyComponent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions