Skip to content

Commit

Permalink
Fixed #5050 - Calendar: panel does not hide when pressing enter
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jan 11, 2024
1 parent 6e1ee87 commit e251feb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions components/lib/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2665,13 +2665,9 @@ export default {
if (this.overlayVisible) {
this.overlayVisible = false;
}
} else if (this.overlayVisible && event.code === 'Enter' && this.manualInput && event.target.value !== null && event.target.value?.trim() !== '') {
try {
if (this.isValidSelection(this.parseValue(event.target.value))) {
this.overlayVisible = false;
}
} catch (err) {
/* NoOp */
} else if (event.code === 'Enter') {
if (this.manualInput && event.target.value !== null && event.target.value?.trim() !== '' && this.isValidSelection(this.parseValue(event.target.value))) {
this.overlayVisible = false;
}
}
},
Expand Down

2 comments on commit e251feb

@antlionguard
Copy link
Contributor

@antlionguard antlionguard commented on e251feb Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put isValidSelection and parseValue into try catch because of this error.
image

if user enters random numbers this methods throws error @tugcekucukoglu

@tugcekucukoglu
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put isValidSelection and parseValue into try catch because of this error. image

if user enters random numbers this methods throws error @tugcekucukoglu

Cache problem. My bad.

Thanks for your attention. I will revert it.

Please sign in to comment.