You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
I'm expecting a @Watch method to fire on a couple of properties, one of which stores an array of points (which can't be reflected) and another property that is simply a boolean. In both cases, finding the element with document.querySelector and then immediately assigning values to both of these properties does not trigger the corresponding @Watch methods for these properties to fire. When the property setting is delayed by 2 seconds through the use of a setTimeout, the @Watch methods do fire in that case, which is unexpected.
Expected behavior:
The corresponding @Watch methods for declared @Props should fire regardless if they are delayed inside a setTimeout.
Open Developer Tools, both the Elements panel and the Console
Notice that there are two instances of <my-component>, one called watcherFails and the other called watcherWorks. The properties set on watcherWorks are wrapped in a setTimeout of 2 seconds whereas the watcherFails is not.
Components are lazy loaded and all stuff (watchers, listeners, methods, etc.) aren't ready with the custom element from the beginning. Using componentOnReady() works, that method returns a promise that is fulfilled when the component is already with all their things. Unfortunately this is not in official stencil doc, I don't know if it's suitable for official use (however, I have been using it in production for a while).
Stencil version:
I'm submitting a:
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior:
I'm expecting a
@Watch
method to fire on a couple of properties, one of which stores an array of points (which can't be reflected) and another property that is simply a boolean. In both cases, finding the element withdocument.querySelector
and then immediately assigning values to both of these properties does not trigger the corresponding@Watch
methods for these properties to fire. When the property setting is delayed by 2 seconds through the use of asetTimeout
, the@Watch
methods do fire in that case, which is unexpected.Expected behavior:
The corresponding
@Watch
methods for declared@Prop
s should fire regardless if they are delayed inside asetTimeout
.Steps to reproduce:
npm i && npm start
<my-component>
, one calledwatcherFails
and the other calledwatcherWorks
. The properties set onwatcherWorks
are wrapped in asetTimeout
of 2 seconds whereas thewatcherFails
is not.Other information:
I posted my dilemma here originally in the Stencil Slack channel https://stencil-worldwide.slack.com/archives/C79EANFL7/p1589911299380700
The text was updated successfully, but these errors were encountered: