When I cancel my getFileForOpening dialog (by either hitting Cancel or escape) the execution of my plugin stops and the assigned result variable doesn’t exist at all. Any idea why that happens? Here’s the code that I use.
I’ve tried the code again and it doesn’t trigger the console output. When I put the getFileForOpening call into a “try” block, the error condition as well as the “Cancel” output are triggered. So it seems as if canceling the Open File dialog triggers an error.
And “const filename …” doesn’t work for the “if” condition afterwards, the “var filename …” version does.
Also … “sp-button” and “sp-action-button” don’t seem to work properly with the dialog either. When I trigger them, after canceling the dialog, another dialog pops up (but can’t be accessed - it’s just open in the background). A normal HTML button seems to work.
I am not able to reproduce any problem using this code or with other plugins. It is difficult to say what might be wrong. Can you see if you still experience the problem when using this sample plugin?