Closed danyelleabarnett closed 7 months ago
Hey @danyelleabarnett, thanks again for opening up these issues! We've changed timeline to no longer emit that error when playhead is undefined. We've also changed it from an error to a warn as per you suggestion, so thank you! This change will be included in the next release, 7.21.0 which will be pushed out this Thursday.
Describe the bug rux-timeline will throw an error when updating the playhead (even if the playhead is set to undefined if going out of range). This appears to be because syncPlayhead is called twice in handleChange.
To Reproduce Stackblitz: https://stackblitz.com/edit/angular-zone-rcdxnp?file=src%2Fapp%2Fapp.component.ts To replicate:
Current behavior When setting playhead to undefined, then setting start and end to their new values, handleChange appears to be using the old value of playhead in the first syncPlayhead call (before start and end time are updated) and throwing the error.
Expected behavior Throwing an error for a playhead out of range seems excessive - it should probably be a warning or info like with the time regions being out of the current range.
Screenshots
CodeSandbox Stackblitz: https://stackblitz.com/edit/angular-zone-rcdxnp?file=src%2Fapp%2Fapp.component.ts
Environment (please complete the following information):
Additional context Sometimes appears to cause issues when setting start and end dates from outside sources - such as calendars - that prevent the timeline from updating the dates it's displaying.