mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-10 17:32:36 +00:00
Removed prev and next element finding errors
This commit is contained in:
parent
d05395dc54
commit
e3ff6a13b0
2 changed files with 13 additions and 5 deletions
|
@ -92,7 +92,7 @@ export default {
|
|||
});
|
||||
},
|
||||
moveToPrev(event) {
|
||||
var prevInput = this.findPrevInput(event.target);
|
||||
let prevInput = this.findPrevInput(event.target);
|
||||
|
||||
if (prevInput) {
|
||||
prevInput.focus();
|
||||
|
@ -100,7 +100,7 @@ export default {
|
|||
}
|
||||
},
|
||||
moveToNext(event) {
|
||||
var nextInput = this.findNextInput(event.target);
|
||||
let nextInput = this.findNextInput(event.target);
|
||||
|
||||
if (nextInput) {
|
||||
nextInput.focus();
|
||||
|
@ -108,12 +108,16 @@ export default {
|
|||
}
|
||||
},
|
||||
findNextInput(element) {
|
||||
var nextElement = element.nextElementSibling;
|
||||
let nextElement = element.nextElementSibling;
|
||||
|
||||
if (!nextElement) return;
|
||||
|
||||
return nextElement.nodeName === 'INPUT' ? nextElement : this.findNextInput(nextElement);
|
||||
},
|
||||
findPrevInput(element) {
|
||||
var prevElement = element.previousElementSibling;
|
||||
let prevElement = element.previousElementSibling;
|
||||
|
||||
if (!prevElement) return;
|
||||
|
||||
return prevElement.nodeName === 'INPUT' ? prevElement : this.findPrevInput(prevElement);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue