Detect if a sheet is open or not

Once a sheet has been created I can get the instance by using app.sheet.get()

console.log(app.sheet.get('#my-sheet'));

But how can I detect if it is open or closed?

var sheet = app.sheet.get('#my-sheet');
var opened = sheet.$el.hasClass('modal-in');
1 Like

Thank you.
I dug deeper into the Dom element after posting that and figured it out, sometimes it’s just the process of posting a question that helps you to figure it out yourself. :slightly_smiling_face:
I had to check for sheet too obviously:

const sheet = app.sheet.get('#my-sheet');
var opened = sheet ? sheet.$el.hasClass('modal-in') : null;
1 Like