New issue
Advanced search Search tips

Issue 666999 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

<button> text does not dispatch click events when its mouseup and mousedown handlers modify its innerHTML

Reported by ben.p...@openreign.com, Nov 19 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1. Open the attached file or go to https://jsfiddle.net/p09cy693/1/
2. Click the button element several times in different place (ie. the center, the edge.
3. 

What is the expected behavior?
First, the mousedown, mouseup, and click events fire in that order.

What went wrong?
Depending on where you click the button element, the click event doe not fire. It seems especially likely not to fire if the button is clicked near the edge. This only happens if the mouseup and mousedown events are listened to.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 
test.html
436 bytes View Download
I tested Microsoft Edge and Firefox. Neither exhibit this behavior.
Components: Blink>DOM>Events Blink>Forms>Button Blink>Input
Status: Untriaged (was: Unconfirmed)
Summary: <button> text does not dispatch click events when its mouseup and mousedown handlers modifies its innerHTML (was: click event is erratic on BUTTON elements when mouseup and mousedown are listened to)
Summary: <button> text does not dispatch click events when its mouseup and mousedown handlers modify its innerHTML (was: <button> text does not dispatch click events when its mouseup and mousedown handlers modifies its innerHTML)

Comment 4 by tkent@chromium.org, Nov 21 2016

Status: Available (was: Untriaged)
Probably an EventHandler.cpp bug.

Comment 5 by hayato@chromium.org, Nov 21 2016

Components: -Blink>DOM>Events

Comment 6 Deleted

The bug does not have anything to do with innerHTML, specifically. It happens when using appendChild as well. I ran a bunch of tests and there seem to be two consistent factors.

1. The contents on the button is changed in the mouseup event.
2. The new button contents contain at least two nodes

Here's a new example. https://jsfiddle.net/p09cy693/3/
The second and third buttons exhibit this behavior. If you click on the button padding, the click event fires. But if you click on the text in the button, the click event does not fire.
Labels: Hotlist-Input-Dev
Owner: nzolghadr@chromium.org
Status: Assigned (was: Available)
nzolghadr@ can you look into this I presume it is something funky going on with the target of the event being replaced and so the event doesn't dispatch to the tree anymore?
This bug has been fixed. It's most likely still open, because it was incorrectly summarized.

Sign in to add a comment