Skip to content

onTouchStart event handler does not work properly on custom elements with display: block #2113

@Nejivoi

Description

@Nejivoi

After upgrading to Preact X onTouchStart event handler stopped working on custom elements with display: block.
Here is code sample:
<custom style={{display: 'block'}} onTouchStart={() => {console.warn('onTouchStart!');}}>Hello, World!</custom>

In devtools Event Listeners I noticed strange event name TouchStart (with capital T and S)
image

If i change event name to ontouchstart it all works fine.
example:
<custom style={{display: 'block'}} ontouchstart={() => {console.warn('onTouchStart!');}}>Hello, World!</custom>

What is strange is that such behavior only occurs in Chrome on my desktop pc. On actual touch devices handler works as intended.

So here is the question. Is it expected behavior?
And if it is, should I change event name for all my components?

Metadata

Metadata

Assignees

No one assigned

    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