Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5008 InputNumber: Cleanup KeyDown #5418

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions components/lib/inputnumber/InputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,23 +376,19 @@ export default {
return;
}
this.lastValue = event.target.value;
if (event.shiftKey || event.altKey) {
this.isSpecialChar = true;
return;
}
this.lastValue = event.target.value;
let selectionStart = event.target.selectionStart;
let selectionEnd = event.target.selectionEnd;
let inputValue = event.target.value;
let newValueStr = null;
if (event.altKey) {
event.preventDefault();
}
Copy link
Member Author

@melloware melloware Mar 14, 2024

Choose a reason for hiding this comment

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

This event.altKey was unreachable based on the short circuit above on line 379

switch (event.code) {
case 'ArrowUp':
this.spin(event, 1);
Expand Down Expand Up @@ -540,7 +536,6 @@ export default {
const isMinusSign = this.isMinusSign(char);
if (((event.code.startsWith('Digit') || event.code.startsWith('Numpad')) && Number(char) >= 0 && Number(char) <= 9) || isMinusSign || isDecimalSign) {
console.log(event.code);
this.insert(event, char, { isDecimalSign, isMinusSign });
}
Expand Down
Loading