[ANGULAR] Default Editor still showing after Replacement
Posted: Thu Oct 28, 2021 6:01 pm
by longevo-florian
Hi,
I replaced the default editor with a custom one just as described in the docs. However, after opening an NgDialog for our own editor and returning false in the function, the default editor still shows up for a split second.
Is this a bug or can I do something to remove that behaviour?
Below you can see some screenshots of the code and the problem I mentioned.
Screenshot 2021-10-28 at 17.47.15.png (136.09 KiB) Viewed 1179 times
Screenshot 2021-10-28 at 17.49.45.png (324.43 KiB) Viewed 1179 times
As you can see in the video, the default editor pops open for just a second and then disappears again. Could you maybe help me with that?
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Fri Oct 29, 2021 8:27 am
by Animal
Disable the eventEdit feature using configuration:
features : {
eventEdit : false
}
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Fri Oct 29, 2021 4:11 pm
by longevo-florian
When I disable the feature completely as you mentioned above, the onBeforeEventEdit event is not emitted anymore, and so I cannot show our custom editor.
Is there any way to keep the custom editor, and stop the default editor from appearing?
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Fri Oct 29, 2021 4:24 pm
by mats
Try listening for beforeEventEdit and return false to stop our default editor from showing.
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Fri Oct 29, 2021 4:26 pm
by longevo-florian
That is what I have been doing already if you see the above screenshots. The default editor still shows up for a split second before then disappearing even though I am returning false.
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Sat Oct 30, 2021 10:39 am
by mats
Ok, sounds very strange. Could you please upload a small test case where this is reproducible (I could not reproduce) so we can debug it?
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Sat Oct 30, 2021 5:45 pm
by longevo-florian
I have prepared a quick example where you can see the problem I mentioned:
Do not use onBeforeXxxxx that prevents an event before the bug is fixed.
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Mon Nov 01, 2021 9:19 pm
by longevo-florian
Hi,
thanks for looking into it! Sadly, your workaround does not work for me, as I am calling this.dialog.open() using a Material Dialog. When I try to put that logic into the object assignment or the constructor of the component like you show above, I get an error saying it cannot read open() of undefined.
I am guessing the object wrapping messes with the context of the this keyword?
Re: [ANGULAR] Default Editor still showing after Replacement
Posted: Tue Nov 02, 2021 10:22 am
by saki
Yes, you're right this points to nowhere or a wrong place. The solution would be to install the listener during initialization. In your case it would boil down into this app.component.ts: