mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-11 01:42:34 +00:00
Fixed #2872 - Dropdown: UpArrow triggers "Uncaught TypeError.." Firefox, Nuxt 3
This commit is contained in:
parent
aafa0ca3a1
commit
615c09a9c7
6 changed files with 33 additions and 14 deletions
|
@ -222,5 +222,24 @@ export default {
|
|||
|
||||
isPrintableCharacter(char = '') {
|
||||
return this.isNotEmpty(char) && char.length === 1 && char.match(/\S| /);
|
||||
},
|
||||
|
||||
/**
|
||||
* Firefox-v103 does not currently support the "findLastIndex" method. It is stated that this method will be supported with Firefox-v104.
|
||||
* https://caniuse.com/mdn-javascript_builtins_array_findlastindex
|
||||
*/
|
||||
findLastIndex(arr, callback) {
|
||||
let index = -1;
|
||||
|
||||
if (this.isNotEmpty(arr)) {
|
||||
try {
|
||||
index = arr.findLastIndex(callback);
|
||||
}
|
||||
catch {
|
||||
index = arr.lastIndexOf([...arr].reverse().find(callback));
|
||||
}
|
||||
}
|
||||
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue