Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged

1

Turns out that the doCloseModal() function was closing the modal before the doDisplayToastMsg() function inside the fetch() was getting a chance to run. The doDisplayToastMsg() after the fetch() was displaying the toast correctly because it ran before the fetch() completed. Solution was to move the doCloseModal() to inside the fetch(), after the ...


2

added You get error message ONLY when this is undefined - not when this is re-scoped to different object. For your toast to work correctly this should refer to class HoldModal as toast should be invoked on instance of the class and not on any other element. Although you are trying to save the scope of this by using const thisReference = this;, the scope of ...


0

You have to many then().then() promises, this scope has changed a lot. Then when you call this.dispatchEvent(toastEvt); , this does not point to the component. A quick thing I can think of is to provide component reference in doDisplayToastMsg doDisplayToastMsg(variant, title, message , componentThis) { const toastEvt = new ShowToastEvent({ ...


Top 50 recent answers are included