Skip to content

Focus delegate algorithm doesn't consider elements assigned to slot #9245

Open
@sefeng211

Description

@sefeng211

Is this expected?

Consider this test case

<section>
    <input type="text" />
</section>
<button>
  Open slotted dialog
</button>

<script>
document.querySelector('button').addEventListener('click', () => {
  document.querySelector('section').shadowRoot.querySelector('dialog').showModal();
});

document.querySelector('section').attachShadow({mode: 'open'});
document.querySelector('section').shadowRoot.innerHTML = '<dialog><slot></slot></dialog>';
</script>

The input element will not be focused upon clicking the button according to the current spec.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions