Closed Bug 1541394 Opened 5 years ago Closed 5 years ago

Input change event not fired when a date or time input is cleared by clicking the X (works in Crome)

Categories

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

67 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1446722

People

(Reporter: irina_h, Unassigned)

Details

Attachments

(1 file)

20.95 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document
Details
Attached file Bugreport Firefox.docx

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36

Steps to reproduce:

The jQuery change() function does not react when a date or time input is set to null by clicking the X (same works in Crome)

Actual results:

The next Codesniplet should count every change of input:

var countkeydown=0;
$('#treatmenttable tr td input').change(function(){
countkeydown=countkeydown+1;
});

Firefox Version 67.0b7 only counts if numbers of the HTML date or time input are changed, but ignores it if the X to delete the value/set it to null is clicked.

(visuals in the attatched file)

Expected results:

In Crome, it counts the events correctly, therefore i assumed that this might be a (minor) bug.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

Attaching an HTML file that reproduces the problem would be useful. This seems to work:

data:text/html,<input type="time" onchange="alert('changed')" value="10:00">

Component: Layout: Form Controls → DOM: Core & HTML
Summary: The jQuery change function does not react when a date or time input is set to null by clicking the X (works in Crome) → Input change event not fired when a date or time input is cleared by clicking the X (works in Crome)

The whole file is quite a big table with many input fields
The aim of the function is to count changes that were made to the input fields for a "close without saving?" allert.
However, i noticed that in Firefox clicking the X to delete the date and time input fields does not call the jQuery function within the script tag.
I know its just a very minor bug, i just noticed.

data:text/html,<input type="date" name="mydate" id="mydate">
data:text/html,<input type="time" name="myarrivaltime" id="myarrivaltime">

<script>

var countkeydown=0;

$('#treatmenttable tr td input').change(function(){
countkeydown=countkeydown+1;
});

</script>

Is this the duplicate of Bug 1446722, which was fixed in 68?

Dear reporter, care to test on the latest nightly?

No matter how, I guess Mirko is able to provide help here. :)

Flags: needinfo?(mbrodesser)
Priority: -- → P3

I just tested it in nightly, there it works fine.

Thank you so much for your help and sorry for wasting your time(:

I tested the reproduction steps Emilio gave with Firefox Version 67.0b7 (as reported by Irina) and there the change event is not fired. I also tested it on Nightly, and there the event is fired. The latter is expected, because it contains the fix of https://bugzilla.mozilla.org/show_bug.cgi?id=1446722.

It would still be interesting to know if Irina's particular use-case works now with Nightly. If so, this issue can be marked as a duplicate of https://bugzilla.mozilla.org/show_bug.cgi?id=1446722.

Flags: needinfo?(mbrodesser)

Irina: thanks for testing it.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: