Skip to content

Provide a way to add portaled (outer) nodes inside FocusScopeΒ #3478

Closed
@yakunins

Description

@yakunins

πŸ™‹ Feature Request

Provide a way to pass into FocusScope nodes, which should consider as a part of it β€” even they are mounted outside of FocusScope node tree (e.g. portaled).

πŸ€” Expected Behavior

Let say we have portaled tooltips with some links, and these tooltips are inside FormDialog.
And we need to have them in its FocusScope in order to be available for tabbing.
Something like that: <FocusScope shards={tooltipRefs}><FormDialog /></FocusScope>

😯 Current Behavior

Any ideas?

πŸ’ Possible Solution

See https://github.com/theKashey/react-focus-lock/blob/master/src/Lock.js#L199

πŸ”¦ Context

FocusScope inner component has portaled nodes with buttons, links, inputs.

πŸ’» Examples

<FocusScope shards={tooltipRefs}>
  <Input1 /> // inside focus scope
  <Input2 /> // inside focus scope
  <Portal>
    <Input3 />  // outside, but we must have it inside focus scope
  </Portal>
</FocusScope>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions