Closed Bug 1314542 Opened 3 years ago Closed 3 years ago

[DateTimeInput] input field cleared unexpectedly when using up/down keys

Categories

(Core :: Layout: Form Controls, defect)

52 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: jessica, Assigned: jessica)

References

(Blocks 1 open bug)

Details

(Whiteboard: [datetime])

Attachments

(1 file, 1 obsolete file)

When millisecond field is empty, using up/down keys in other fields will clear all the fields unexpectedly.
Attached patch patch, v1. (obsolete) — Splinter Review
Whiteboard: [datetime]
Attached patch patch, v1.Splinter Review
Check for millisecond as well when setting input element's value, otherwise it will try to set input element's value to "hh:mm:ss." which is not a valid time string, hence value becomes empty string.
Attachment #8806641 - Attachment is obsolete: true
Attachment #8807446 - Flags: review?(mconley)
Comment on attachment 8807446 [details] [diff] [review]
patch, v1.

Review of attachment 8807446 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!

::: toolkit/content/widgets/datetimebox.xml
@@ +328,5 @@
>              } else if (aTargetField == this.mMinuteField) {
>                value = now.getMinutes();
>              } else if (aTargetField == this.mSecondField) {
>                value = now.getSeconds();
> +            } else if (aTargetField == this.mMillisecField) {

Gah! Good catch!
Attachment #8807446 - Flags: review?(mconley) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/eab190f5dc94
Verify millisecond field when setting input time elemet's value. r=mconley
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/eab190f5dc94
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.