I want to use rome datetimepicker. If the user selects date do not hide the datetime picker. Hide it only after time selection. I am using this library https://bevacqua.github.io/rome/
Asked
Active
Viewed 369 times
1 Answers
0
Setting the autoClose
to time
hides the picker only after the user selects a time. Otherwise, it will keep the picker visible:
The documentation reference:
autoClose: When set to true, the calendar is auto-closed when picking a day _(or a time if time: true and date: false). A value of 'time' will only auto-close the calendar when a time is picked.
And here you can see an example using those same configuration:
const input = document.querySelector('#input')
rome(input, {
autoClose: 'time'
})
<link href="https://cdn.jsdelivr.net/npm/rome@3.0.0/dist/rome.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/rome@3.0.0/dist/rome.min.js"></script>
<input id="input" autocomplete="off" />

a--m
- 4,716
- 1
- 39
- 59
-
This still closes when date is selected. I want to close only if time is selected – anduplats Apr 18 '20 at 11:54