ESRI JS API 4.11: Cannot destroy Editor widget

705
4
Jump to solution
04-12-2019 10:44 AM
NicolasGIS
Occasional Contributor III

Hello,

I just noticed that the Editor widget cannot be destroyed: an error occurs and the widget is not destroyed:

Codepen

Thanks,

Nicolas

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
UndralBatsukh
Esri Regular Contributor

Hi there, 

Thank you for reporting this issue. We will address it in our next release.

-Undral

View solution in original post

0 Kudos
4 Replies
KenBuja
MVP Esteemed Contributor

However, if you try to use the editor after destroying it, it's not working. Adding in a console.log(editor) after destroying it will give you

TypeError: null has no properties

You just have to manually remove the editor from the view.ui before destroying it.

setTimeout(() => {
  alert("Editor should be destroyed");
  view.ui.remove(editor);
  editor.destroy();
  console.log(editor);
}, 10000);‍‍‍‍‍‍
0 Kudos
NicolasGIS
Occasional Contributor III

Thanks for the suggestion Ken Buja‌ but then clicking on the map returns an error because the widget is not properly destroyed

0 Kudos
UndralBatsukh
Esri Regular Contributor

Hi there, 

Thank you for reporting this issue. We will address it in our next release.

-Undral

0 Kudos
NicolasGIS
Occasional Contributor III

Hi Undral Batsukh‌,

Thanks for the update!

0 Kudos