Skip to content

Currently, Does the Sheet component have a way to disable autofocus on open? #1342

Discussion options

You must be logged in to vote

Yeah.. thats what I thought would happen... Well, I have come with a "solution".

<script>
  function disableAutofocus(): FocusTarget {
    return document.querySelector(".disable-autofocus") as FocusTarget;
  }
</script>

<Sheet open={p !== null} openFocus={() => disableAutofocus()}>
  <SheetContent>
    <!-- Disable autofocus -->
    <span
      class="disable-autofocus"
      tabindex="-1"
    />
...

This is nasty but works, I guess I will use this.
I appreciate the help @nikitaiavdeev =)

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@oriolmontcreus
Comment options

Comment options

You must be logged in to vote
3 replies
@oriolmontcreus
Comment options

@nikitaiavdeev
Comment options

@oriolmontcreus
Comment options

Answer selected by oriolmontcreus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants