Fixed #5094 - InputNumber: Home and End key defects

pull/5098/head
tugcekucukoglu 2024-01-16 15:02:08 +03:00
parent c9f24c7126
commit 0d9ee94b60
1 changed files with 7 additions and 5 deletions

View File

@ -107,7 +107,7 @@ import Button from 'primevue/button';
import AngleDownIcon from 'primevue/icons/angledown'; import AngleDownIcon from 'primevue/icons/angledown';
import AngleUpIcon from 'primevue/icons/angleup'; import AngleUpIcon from 'primevue/icons/angleup';
import InputText from 'primevue/inputtext'; import InputText from 'primevue/inputtext';
import { DomHandler } from 'primevue/utils'; import { DomHandler, ObjectUtils } from 'primevue/utils';
import BaseInputNumber from './BaseInputNumber.vue'; import BaseInputNumber from './BaseInputNumber.vue';
export default { export default {
@ -533,17 +533,19 @@ export default {
break; break;
case 'Home': case 'Home':
if (this.min) { event.preventDefault();
if (!ObjectUtils.isEmpty(this.min)) {
this.updateModel(event, this.min); this.updateModel(event, this.min);
event.preventDefault();
} }
break; break;
case 'End': case 'End':
if (this.max) { event.preventDefault();
if (!ObjectUtils.isEmpty(this.max)) {
this.updateModel(event, this.max); this.updateModel(event, this.max);
event.preventDefault();
} }
break; break;