Bug 1824323 - Open picker from datetimebox to get current date/time value. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173959
This commit is contained in:
@@ -5724,10 +5724,14 @@ void HTMLInputElement::ShowPicker(ErrorResult& aRv) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsDateTimeInputType(mType) && IsInComposedDoc()) {
|
||||
DateTimeValue value;
|
||||
GetDateTimeInputBoxValue(value);
|
||||
OpenDateTimePicker(value);
|
||||
if (CreatesDateTimeWidget() && IsInComposedDoc()) {
|
||||
if (RefPtr<Element> dateTimeBoxElement = GetDateTimeBoxElement()) {
|
||||
// Event is dispatched to closed-shadow tree and doesn't bubble.
|
||||
RefPtr<Document> doc = dateTimeBoxElement->OwnerDoc();
|
||||
nsContentUtils::DispatchTrustedEvent(doc, dateTimeBoxElement,
|
||||
u"MozDateTimeShowPickerForJS"_ns,
|
||||
CanBubble::eNo, Cancelable::eNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user