New issue
Advanced search Search tips

Issue 814271 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Setting checked content attribute on radio input on click is applied after the default action

Reported by ruc...@gmail.com, Feb 21 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36

Steps to reproduce the problem:
1. i have a form with several radio buttons layered out horizontally
2. when i select one it automatically selects the last one, regardless if i selected a different one
3. i have to select again so it selects the one i want

What is the expected behavior?
i should be able to select with one click the options i want

What went wrong?
chrome selects allways the last option on the first click

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 64.0.3282.167  Channel: n/a
OS Version: 10.0
Flash Version:
 
chrome error.txt
57.5 KB View Download
Labels: Needs-Triage-M64

Comment 2 by rakina@chromium.org, Feb 22 2018

Labels: Needs-TestConfirmation
Hmm, I can't seem to reproduce the issue on my machine. Sending to Test Engineering team.

Can you elaborate more on your environment/did you do anything after the page loaded before selecting an option?

Comment 3 by rakina@chromium.org, Feb 22 2018

Labels: Needs-Feedback

Comment 4 by phistuck@gmail.com, Feb 22 2018

You did not supply required JavaScript files, so your attachment works without a problem.
My guess is that something in your JavaScript, or third party JavaScript files make this issue happen.
Please, provide a standalone test package that will reproduce the issue out of the box, without any modification (otherwise there could be an unrelated problem in our reproduction instead of the problem that you are actually having).

Comment 5 by ruc...@gmail.com, Feb 22 2018

Hi

Nothing else happens. Is a survey page that loads same way as others. 

Attached is a little video

You can check in this url 

http://www.bbk.ac.uk/psychology/psychologyexperiments/experiments/thoughtsaffect/quests/quest3.php?r=1&p=5&d=3&dn=0&b=0&sst=2&sstl=0&m=9e119a2b38d5841b561b8eab334969b8

Thanks for looking into it 

Rubén
Project Member

Comment 6 by sheriffbot@chromium.org, Feb 22 2018

Cc: rakina@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by phistuck@gmail.com, Feb 22 2018

Components: -Blink>DOM Blink>Forms>Radio
Status: Untriaged (was: Unconfirmed)
Summary: Setting checked content attribute on radio input on click is applied after the default action (was: Horizontal radio buttons)
Interesting. Here is a reduced test case -
data:text/html,<!doctype html><script>window.addEventListener('click', function(){[...document.querySelectorAll('input')].forEach(function(item){item.setAttribute('checked', 'checked')});})</script><input type=radio name="a"><input type=radio name="a">

<!doctype html>
<script>
	window.addEventListener('click', function()
	{
		[...document.querySelectorAll('input')].forEach(function(item)
		{
			item.setAttribute('checked', 'checked')
		});
	})
</script>
<input type=radio name="a">
<input type=radio name="a">

Looks like Chrome first checks a checkbox (commits the default action) and then runs the click handler (which applies setAttribute("checked", "checked") and thus setting the last one as checked). I guess it does not happen the second time because the value of the "checked" content attribute does not change, so no checkedness change is triggered.

Comment 8 by tkent@chromium.org, Feb 22 2018

Labels: -Needs-TestConfirmation
This strange behavior comes from "legacy-pre-activation behavior" https://html.spec.whatwg.org/multipage/input.html#the-input-element:legacy-pre-activation-behavior

Safari's behavior is same as Chrome.

I'll investigate more later.

Comment 9 by tkent@chromium.org, Feb 23 2018

Status: WontFix (was: Untriaged)
Edge agrees with Chrome and Safari, and the behavior matches to the standard.
So, this is a bug of the web site.

Sign in to add a comment