quasar
quasar copied to clipboard
Multiple Selection Date Picker weird behavior
What happened?
Let's say I am using a multiple-selection date picker and unselected a date, currently now it will auto focus to the last element
What did you expect to happen?
When unselect a date, no auto focus/navigation should happen and I am still able to select other dates in the same month
Reproduction URL
https://quasar.dev/vue-components/date#multiple-selection
How to reproduce?
- Select any date
- Select another date in different month/year
- Unselect the date you just selected
- You will see it will auto focus to the first date you selected
Flavour
Vue CLI Plugin (vue-cli-plugin-quasar)
Areas
Components (quasar)
Platforms/Browsers
Chrome
Quasar info output
No response
Relevant log output
No response
Additional context
No response
Hi @qashier-ray-foo! 👋
It looks like you provided an invalid or unsupported reproduction URL. Do not use any service other than Codepen, jsFiddle, StackBlitz, Codesandbox, and GitHub. Make sure the URL you provided is correct and reachable. You can test it by visiting it in a private tab, another device, etc. Please edit your original post above and provide a valid reproduction URL as explained.
Without a proper reproduction, your issue will have to get closed.
Thank you for your collaboration. 👏
function getViewModel (mask, locale) {
const model = Array.isArray(props.modelValue) === true
? props.modelValue
: (props.modelValue ? [ props.modelValue ] : [])
if (model.length === 0) {
return getDefaultViewModel()
}
const target = model[ model.length - 1 ]
const decoded = decodeString(
target.from !== void 0 ? target.from : target,
mask,
locale
)
return decoded.dateHash === null
? getDefaultViewModel()
: decoded
}
After checking the source code, my current tricky workaround: adding an invalid date to the end of qdate value, e.g. ["2024/05/01", "2024/05/02", "foo"], then the default-year-month
param will take effect and disable auto focus.
Of course, it would be great if an option was available to control this behaviour...