Open Bug 1658315 Opened 4 years ago Updated 2 years ago

<input type="radio">/<input type="checkbox"> do not block the default action of parent links

Categories

(Core :: DOM: Core & HTML, defect, P3)

79 Branch
defect

Tracking

()

UNCONFIRMED
Webcompat Priority P3

People

(Reporter: orstavik77, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

In this template:

<a href="#radio-interference">
<input type="radio" name="x">
<input type="radio" name="x">
</a>

<a href="#checkbox-interference">
<input type="checkbox">
</a>

I click on
a) a radio-button or
b) the checkbox.

Actual results:

1a. The radio button gets selected.
AND
2a. The page navigates to #radio-interference

1b. The checkbox toggles
AND
2b. The page navigates to #checkbox-interference

Expected results:

  1. Only the radio button/checkbox should toggle.

The HTMLAnchorElement's default action of navigation should not occur in addition to the HTMLInputElement's default action.

Why?

  1. It would be confusing if two such default actions occurred at the same time/in response to the same event instance Yes, there can be two default actions associated with one event instance, but no, these two default actions should mutually exclude each other.
  2. Chrome 81.0.4044.129 and WebKitGTK 2.28.2 only triggers the default action nearest the innermost target: they don't navigate also.

----------testfile.html------------------
<a href="#radio-interference">
<input type="radio" name="x">
<input type="radio" name="x">
</a>

<a href="#checkbox-interference">
<input type="checkbox">
</a>

  1. click on the radios/checkbox and see both the results in the browser (the buttons toggle AND the hash changes).

  2. repeat test in Chrome and Safari, and see they behave differently (the hash in the url doesn't change).

I'm not sure how this is serious because according to the Alice-san's bug list, this is long standing bug.

Webcompat Priority: --- → ?

Added a related bug. It illustrates how the conflict between the form/input vs. aHref are resolved differently in other similar situations.
https://bugzilla.mozilla.org/show_bug.cgi?id=1658511

Severity: -- → S3
Priority: -- → P3
Webcompat Priority: ? → P3
Summary: input type radio does not block the default action of links → <input type="radio">/<input type="checkbox"> do not block the default action of parent links
You need to log in before you can comment on or make changes to this bug.