Open Bug 1848790 Opened 1 year ago Updated 1 year ago

If you restore a recently closed tab, an input event is triggered on textareas

Categories

(Firefox :: Session Restore, defect)

Firefox 115
Desktop
All
defect

Tracking

()

Tracking Status
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox116 --- wontfix
firefox117 --- wontfix
firefox118 --- fix-optional

People

(Reporter: cgerharz, Unassigned, NeedInfo)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

Attached file example.html (deleted) —

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

Steps to reproduce:

I have a webpage loaded which contains a textarea.

On "input" events the textarea sets an attribute to mark the textarea as changed. This attribute is used to warn the user "on unload", i.e. when he leaves the page before saving the changes.

If I close the tab without any changes to the textarea and then restore the tab, Firefox triggers an input event on the textarea. This marks the textarea as "changed", although the user has not made any changes, and there was no input to the textarea at all.

Actual results:

When restoring the closed tab, any textarea receives an "input" event, although there was no input at all.

Expected results:

The textareas should not receive an input event.

I understand, that it's a good idea to restore possible content of textareas when restoring a closed tab. However if there was no change at all and/or the textarea has no content, I do not expect to receive an "input" event.

btw.: Inputs of type=text receive an "input" event too, but only if you changed the input's value and its value is not blank.
If the input field loaded with value 'a' and you delete the 'a' character, the 'a' will be restored when the tab is restored.
In textareas however if it originally loaded with content 'a' and you deleted the 'a' character, after restoring the tab, the textarea is restored with blank value.

To me this feels inconsistent.

Chrome restores a tab and the contents of textareas and input fields just as they were when you left the page, but no input events are fired.
This is the behaviour I would appreciate in Firefox as well.

The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Tabbed Browser
Component: Tabbed Browser → Session Restore
OS: Unspecified → All
Hardware: Unspecified → Desktop

Set release status flags based on info from the regressing bug 1572084

:farre, since you are the author of the regressor, bug 1572084, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: