I was creating a chrome extension and I added a date time picker. Whenever I choose date and time it should show the chosen value in the input html field. However, it is not showing in my case.
<input type="datetime-local" name="" id="date-el">
I use the above html code to add date time picker on my chrome extension popup.html. I also have a background service worker for database. After, doing some random test, I found that the date time picker works normally when I remove the background service worker.
Background.js service worker runs on the background all the time. Does it block the date inputs from updating? Is there a relation between chrome extension service worker and html5 date time input?
Could you try with this code, maybe you need to put it a form
<form>
<h2> Try Clicking Submit</h2>
<hr />
<label for="via-html">Set with HTML value attribute (Works fine!)</label>
<br />
<input id="via-html" type="datetime-local" value="1980-01-01T01:01:01.001"/>
<br />
<br />
<label for="via-js">Set with JavaScript (Fails Validation!)</label>
<br />
<input type="datetime-local" id="via-js"/>
<hr />
<input type="submit" />
</form>