amsul / amsul/pickadate.js

Event click error in indexOf property in picker.js file

Offen
#1,237 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
7.6k
Forks
981
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This error happen using a node app, in the web app work perfectly. When an event click occurs with the picker the function "getRealEventTarget" receive the event and the element.
`function getRealEventTarget( event, ELEMENT ) {

var path = []

if ( event.path ) {
path = event.path
}

if ( event.originalEvent && event.originalEvent.path ) {
path = event.originalEvent.path
}

if ( path && path.length > 0 ) {
if ( ELEMENT && path.indexOf( ELEMENT ) >= 0 ) {
return ELEMENT
} else {
return path[0]
}
}

return event.target
}`
In the node app the variable path is not an array but a nodeList and nodeList don't have the property "indexOf" giving in the consle the error "undefined is not a function" and stop executing the next code and ,in my case, preventing me from closing the calendar keeping it open.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.