Skip to content

FocusMixin: focus and blur events are not redispatched with { composable: true } #2693

Description

@jessevanassen

Expected behavior

I expect I can listen to focus and blur events that are dispatched by Lion's FocusMixin

Actual Behavior

The FocusMixin redispatches focus and blur events. However, the native events are dispatched using { composed: true }, which the FocusMixin doesn't do. That means Lion's focus and blur cannot be listened to on a parent web component:

<p>
	<template shadowrootmode="open">
		<lion-input placeholder="Lion input"></lion-input>
	</template>
</p>

If I put a focus or blur listener on the <p>, the listener doesn't fire when focusing the <lion-input>. If I replace the <lion-input> to a regular <input>, the listener does fire.

Full reproduction: https://stackblitz.com/~/github.com/jessevanassen/lion-ui-focusmixin-redispatch-reproduction?file=index.html.
Only focus and blur events are fired by the <input>, not by the <lion-input>.

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