Closed Bug 1479708 Opened Last year Closed Last month

Required date input still has a clear button

Categories

(Toolkit :: XUL Widgets, defect, P3)

61 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mcorteel, Assigned: bugzilla)

References

(Blocks 1 open bug, )

Details

(Keywords: parity-chrome, testcase)

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180704194937

Steps to reproduce:

Create a form with a required date input and set its value. (See https://codepen.io/anon/pen/VBQeQW)


Actual results:

The input contains a clear button.


Expected results:

It shouldn't, because if you clear the input, the validation will always fail.
I'm not completely sure if it's a bug or a feature, but it doesn't make much sense.
Has STR: --- → yes
Component: Untriaged → Layout: Form Controls
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Priority: -- → P3
(In reply to Maxime Corteel from comment #0)

> It shouldn't, because if you clear the input, the validation will always
> fail.
> I'm not completely sure if it's a bug or a feature, but it doesn't make much
> sense.

I believe this is a bug. Chrome correctly hides the clear button when the required attribute is set.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Putting this in Toolkit > XUL Widgets since it appears the current datetimebox widget does not appear to respect the required attribute.

The method updateResetButtonVisibility in datetimebox.xml looks to see if any field is non-empty in the widget, and if it is, sets the mResetButton visibility to visible.

See https://searchfox.org/mozilla-central/source/toolkit/content/widgets/datetimebox.xml#1373
Component: Layout: Form Controls → XUL Widgets
Product: Core → Toolkit
Attachment #9079042 - Attachment is obsolete: true
Duplicate of this bug: 1561787
See Also: → 1561787
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a506f9517ba2
Hide required date time input reset button. r=emilio

Sorry the change had to be backed out. The test failure wasn’t caught earlier because the try server run did not test the mobile version.

Flags: needinfo?(bugzilla)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d066652bc2f
Hide required date time input reset button. r=emilio
Status: NEW → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → bugzilla
You need to log in before you can comment on or make changes to this bug.