Closed Bug 1797139 Opened 2 years ago Closed 2 years ago

input element stopped working after change type from date to datetime-local

Categories

(Core :: Layout: Form Controls, defect)

Firefox 106
defect

Tracking

()

VERIFIED FIXED
108 Branch
Tracking Status
relnote-firefox --- 106+
firefox-esr102 --- unaffected
firefox106 --- verified
firefox107 --- verified
firefox108 --- verified

People

(Reporter: info, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(4 files)

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

Steps to reproduce:

Have this element:
<input name="from" id="from" title="Začátek" value="" type="date" class="input-text required-entry" aria-required="true">

Change type with this jquery code:
$('#from').prop('type', 'datetime-local');

Actual results:

Input element is unusable (attached image).

Expected results:

Element should change type and accept data from user.

The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core
Component: Disability Access APIs → Layout: Form Controls
Attached file testcase 1

Thanks for the bug report! I can reproduce something like this. Here's a reduced testcase that triggers the issue for me. In my case, the "test" input ends up collapsing to nearly-nothing (just the "x") after the dynamic tweak.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Tiaan tracked down a regression range:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5af1fe905b87d9b1662b0de9336d2280ccafc73a&tochange=35362dccb42a5e4b39c851f7aa86c8a9e2952a91

...which points to bug 1734221, which indeed changed some localization related stuff around datetime input fields. Maybe there's a race condition and we're failing to look up the localized format/fields here?

(That bug landed for 106, so that means we've shipped this regression to release.)

Severity: -- → S2
Regressed by: 1734221
Flags: needinfo?(earo)

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

Assignee: nobody → emilio
Flags: needinfo?(earo)

destructor() should really clean-up after setup(), not the
constructor(), since setup() can be called multiple times.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/35fe1522cb09
Don't null out l10n from destructor(). r=dholbert,Gijs

Comment on attachment 9300291 [details]
Bug 1797139 - Don't null out l10n from destructor(). r=dholbert,Gijs

Beta/Release Uplift Approval Request

  • User impact if declined: Fixes layout of datetime <input>s when switching types.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: See test-case attached.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Very straight-forward fix.
  • String changes made/needed: none
  • Is Android affected?: Yes
Attachment #9300291 - Flags: approval-mozilla-beta?
Flags: qe-verify+

(In reply to info from comment #0)

Thanks for the report. As a workaround, you can set type to text before datetime-local. That should avoid hitting the bug.

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36663 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triaged]

I managed to reproduce this issue on a 2022-10-25 Nightly build on Ubuntu 22, using the testcase from Comment 2. Verified as fixed on Nightly 108.0a1(build ID: 20221026224258) on Ubuntu 22, macOS 12, Windows 10.

Comment on attachment 9300291 [details]
Bug 1797139 - Don't null out l10n from destructor(). r=dholbert,Gijs

Approved for 107.0b6.

Attachment #9300291 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I managed to reproduce this issue on Firefox 107.0b5(build ID: 20221025185841) on Windows 10 using the testcase from Comment 2. Verified as fixed on Firefox 107.0b6(build ID: 20221027185833) on Windows 10, macOS 12, Ubuntu 22.

Per discussion with RyanVM, let's get this into the next dot release as well.

Comment on attachment 9300291 [details]
Bug 1797139 - Don't null out l10n from destructor(). r=dholbert,Gijs

Beta/Release Uplift Approval Request

  • User impact if declined: Broken layout of datetime <input>s when switching types.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: See test-case attached.
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Very straight-forward fix.
  • String changes made/needed: none
  • Is Android affected?: Yes
Attachment #9300291 - Flags: approval-mozilla-release?

Comment on attachment 9300291 [details]
Bug 1797139 - Don't null out l10n from destructor(). r=dholbert,Gijs

Approved for 106.0.4.

Attachment #9300291 - Flags: approval-mozilla-release? → approval-mozilla-release+

I confirm this fix is verified on Firefox 106.0.4(build ID: 20221102214123) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: