Problem
In my app, I'm launching the ChatKit component within a modal. Generally, it's working fine, but the ability to hit Esc in order to close the modal is expected user behavior, but it's not possible because the ChatKit input field and other focus elements are within an iframe. So there's no way for me to tap into the KeyUp event on the input, detect an Esc key, and then close the modal.
Solution
I'm not sure what the best solution is. A dedicated postMessage event doesn't feel right for something so specific to the external environment. And, as far as I can tell, there's no native "use this as a modal" behavior built into ChatKit that I can tap into. So, I'm open to suggestions about the best approach here.
Problem
In my app, I'm launching the ChatKit component within a modal. Generally, it's working fine, but the ability to hit
Escin order to close the modal is expected user behavior, but it's not possible because the ChatKit input field and other focus elements are within an iframe. So there's no way for me to tap into the KeyUp event on the input, detect anEsckey, and then close the modal.Solution
I'm not sure what the best solution is. A dedicated
postMessageevent doesn't feel right for something so specific to the external environment. And, as far as I can tell, there's no native "use this as a modal" behavior built into ChatKit that I can tap into. So, I'm open to suggestions about the best approach here.