vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
605 stars 166 forks source link

vaadin-dialog with custom WebComponent throws an error when opened for the 2nd time #4374

Closed SomeoneToIgnore closed 6 years ago

SomeoneToIgnore commented 6 years ago

Based on https://vaadin.com/forum/thread/17155816/vaadin-dialog-and-google-map-marker

Project to reproduce: https://github.com/jcgueriaud/test

Live demo: https://date-tester-vaadin10.herokuapp.com/popupMap Local way to reproduce: run the jetty in the project (development mode), open http://localhost:8080/popupMap

Click any button then click Show Dialog 2 button.

Expected: the dialog is shown 2nd time Actual: a client-side exception is thrown:

Uncaught TypeError: Cannot read property 'click' of undefined
    at HTMLElement._clearListener (google-map-marker.html:470)
    at HTMLElement._clickEventsChanged (google-map-marker.html:324)
    at Object.runObserverEffect [as fn] (property-effects.html:217)
    at runEffectsForProperty (property-effects.html:162)
    at runEffects (property-effects.html:128)
    at HTMLElement._propertiesChanged (property-effects.html:1711)
    at HTMLElement._flushProperties (properties-changed.html:341)
    at HTMLElement._flushProperties (property-effects.html:1559)
    at HTMLElement.ready (property-effects.html:1664)
    at HTMLElement.ready (element-mixin.html:546)
    at HTMLElement.ready (dir-mixin.html:140)
    at HTMLElement.ready (legacy-element-mixin.html:199)
    at HTMLElement.ready (class.html:232)
    at HTMLElement._enableProperties (properties-changed.html:321)
    at HTMLElement.connectedCallback (properties-mixin.html:208)
    at HTMLElement.connectedCallback (element-mixin.html:532)
    at HTMLElement.connectedCallback (dir-mixin.html:150)
    at HTMLElement.connectedCallback (legacy-element-mixin.html:103)
    at HTMLElement._attachDom (element-mixin.html:588)
    at HTMLElement._readyClients (element-mixin.html:561)
    at HTMLElement._flushClients (property-effects.html:1573)
    at HTMLElement.ready (property-effects.html:1668)
    at HTMLElement.ready (element-mixin.html:546)
    at HTMLElement.s.ready (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at HTMLElement._enableProperties (properties-changed.html:321)
    at HTMLElement.connectedCallback (properties-mixin.html:208)
    at HTMLElement.connectedCallback (element-mixin.html:532)
    at HTMLElement._templateChanged (vaadin-overlay.html:677)
    at Object.runMethodEffect [as fn] (property-effects.html:818)
    at runEffectsForProperty (property-effects.html:162)
    at runEffects (property-effects.html:128)
    at HTMLElement._propertiesChanged (property-effects.html:1711)
    at HTMLElement._flushProperties (properties-changed.html:341)
    at HTMLElement._flushProperties (property-effects.html:1559)
    at HTMLElement._invalidateProperties (property-effects.html:1531)
    at HTMLElement._setProperty (property-effects.html:1516)
    at HTMLElement.Object.defineProperty.set (properties-changed.html:150)
    at HTMLElement._openedChanged (vaadin-dialog.html:142)
    at Object.runMethodEffect [as fn] (property-effects.html:818)
    at runEffectsForProperty (property-effects.html:162)
    at runEffects (property-effects.html:128)
    at HTMLElement._propertiesChanged (property-effects.html:1711)
    at HTMLElement.s._propertiesChanged (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at HTMLElement._flushProperties (properties-changed.html:341)
    at HTMLElement._flushProperties (property-effects.html:1559)
    at HTMLElement.ready (property-effects.html:1664)
    at HTMLElement.ready (element-mixin.html:546)
    at HTMLElement.ready (vaadin-dialog.html:129)
    at HTMLElement.s.ready (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at HTMLElement._enableProperties (properties-changed.html:321)
    at HTMLElement.connectedCallback (properties-mixin.html:208)
    at HTMLElement.connectedCallback (element-mixin.html:532)
    at jv (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:936)
    at Bv (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:897)
    at Ax.Bx [as W] (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at Yz (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:861)
    at Pq (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:973)
    at dr.er [as D] (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at Aj (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:407)
    at Hq (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:974)
    at Iq (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:958)
    at Ss.Us [as qb] (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at AA.BA [as K] (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:978)
    at XMLHttpRequest.<anonymous> (client-BF4676DDAFDA5E40AE93EFEB692AAAD5.cache.js:570)
Artur- commented 6 years ago

See https://github.com/GoogleWebComponents/google-map/issues/407

SomeoneToIgnore commented 6 years ago

Thanks.

I see that there also pul requests that fix the issue, so maybe one of them gets merged some day.

jcgueriaud commented 6 years ago

Thanks for your fast answer.

I've just add a comment on vaadin forum post (because it's not an issue).