How to control the placeholder-text of the webkit-calendar? #870
-
I'm using the in a web application to select a month. Initially, the selected month is displayed correctly in the input field. However, when the user clears the input, the native "löschen" button of the Webkit calendar (which is part of the browser's built-in UI) appears, and the input field shows ------- --. I want to customize the behavior of this clear button to display a custom text instead of the default ------- --, or hide the clear button entirely when the user clears the input field. I've tried using a placeholder and other styling techniques but haven't been able to get the desired behavior. How can I modify the placeholder-text or hide the default "löschen" button when the input field is cleared? Any help or suggestions would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The input with type="month" only works in chromium based browsers like Chrome, Edge or Opera. |
Beta Was this translation helpful? Give feedback.
The input with type="month" only works in chromium based browsers like Chrome, Edge or Opera.
If you want the user to select a date range I would suggest to use 2 input type="date" instead. One for the start of the range, one for the end date. You can filter your entries with something like
entry.date > startDate && entry.date < endDate
afterwards.Please make sure to set the lower boundary for the enddate with
<input type="date" min={startDate}>
. Hope that helps!