Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inspect HTML5 date picker shadow DOM

Tags:

I'm trying to inspect the shadow DOM for certain HTML5 controls, like the date picker for the input type="date" and the actual suggestion dropdown list for inputs bound to a datalist. Preferably in Chrome, but other browsers will do too.

I've found that by enabling the Shadow DOM setting in Chrome's inspector options allows me to inspect the shadow DOM for the actual input (which includes the ::-webkit-calendar-picker-indicator arrow to show the datepicker) but not the datepicker itself:

enter image description here

The same goes for the datalist. It appears as these controls are not part of the input, but I also can't find them anywhere else in the elements panel.

Is it possible to inspect such elements?

Small edit for clarification: I'm actually looking for which pseudo-classes apply to which controls. There's plenty of sites that list some of them, but I have yet to find a source that manages to list ::-webkit-calendar-picker-indicator for the datalist element, which does get applied. I'm looking for more of those sneaky bastards, and the best source for that of course is the horse's mouth.

like image 651
Stephan Muller Avatar asked Apr 24 '15 08:04

Stephan Muller


1 Answers

Looks like the actual picker is loaded in an entirely different layer (basically a different window without the titlebar). So I guess the answer is: no, you can't.

enter image description here

I agree it would be great to be able to customize it. And similar popups too. Mozilla in XUL has display:popup which is used by context menus, flyout and similar things. Would be definitely great being able to use that in userland content too.

like image 195
Wes Avatar answered Sep 19 '22 19:09

Wes