How to remove the close icon associated with semantic modal via js code #1768
-
Hi Experts, We have the close icon on each of the two modals we show up on the page one after the other[i.e, kind of modal chaining]. However, we do not want to show the close icon on the modal which opens along with the second modal. We have "" available with the modal markup/html. However, we do not want to remove it from the html, but when the modal loads on the page, the close icon needs to be removed from the modal. Is there any way we can remove Any thoughts/pointers/reference code will be really helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Usually the parent modal is covered with a dimmer when a child modal is shown. This should prevent clicking on the close icon on the parent modal. Does this help? Because I guess, your use case is to prevent clicking on the close icon of the parent modal? Please share a jsfiddle with your current code so we might find out why your js approach was not working for you |
Beta Was this translation helpful? Give feedback.
-
Use this as a base. As you can see, the close icon of the parent is blocked when the first is opened. I also added |
Beta Was this translation helpful? Give feedback.
-
I just created from @lubber-de fiddle (https://jsfiddle.net/ko2in/Lhdzf0o1/7/). The close icon on second modal will be hidden when you open. You can remove completely base on this example if you want to. I'm not sure it's what you're looking for. If you can't create the fiddle or sandbox to demonstrate your implementation, then we wouldn't be able to help you much. |
Beta Was this translation helpful? Give feedback.
Use this as a base.
https://jsfiddle.net/lubber/v0kqrwds/15/
As you can see, the close icon of the parent is blocked when the first is opened. I also added
closable:false
which additionally prevents closing the modals when the dimmer is clicked.