Workspace Modal ignores option to Hide Close Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 10:24 AM - edited ‎08-20-2024 10:26 AM
I am trying to create a modal on a record page which adds a new related record to the record being viewed. If the user decides to cancel, I am deleting the related record (I need to create a new record before I open the modal so the attachments can be hooked up correctly).
However, despite everything I've tried, I cannot remove the (X) in the upper right hand corner of the modal. If the user clicks this, or if they hit Escape, the modal dialog is closed without updating or deleting the record.
I have made sure to check off "Hide Close Button" in the configuration of the modal.
On the temporary button I'm using to open the modal dialog for testing purposes, I have also included the Display option of "disableDismiss: true", as instructed in the tooltip for Display options.
This was done by selecting true within the Display Options.
I recognize that the tooltip states that this is specifically if I'm using a bare modal, but I don't see an option anywhere to make my modal bare. I've seen this option in other configurations, but not within the modal configuration.
After investigating the JavaScript through my browser's developer tools, I noticed that in the file @Servicenow/now-modal/src/now-modal.js, there's a function called `renderCloseButton`. This takes in the parameter disableClose, but everytime my debugger stops at that step, it seems disableClose is false, despite all of the settings I have checked off in the Open Modal event and the Modal configuration. However, this function seems to be getting called on page load (despite both of my modals defering their content loading) so it's possible I'm not seeing the correct events.
Does anyone have insight into the functionality of disabling the close button on a modal? Please let me know if I can provide any more information to be of assistance. I am in Xanadu.