Issue 1: Internal TextField focus is not released after ModalPane is hidden
Description: When a text field inside a ModalPane acquires focus and the modal is subsequently closed (hidden) by clicking the outside area or pressing ESC, the focus is not released from the text field.
This results in "focus trapping" on an invisible element:
- Subsequent keyboard inputs continue to be captured by the hidden text field.
- Global keyboard shortcuts (e.g., triggering the modal via
/) fail to work because the event is consumed by the focused (but hidden) text field.
- When the
ModalPane is reopened, the unintended input typed while it was hidden becomes visible.
Steps to reproduce:
- Open a
ModalPane that contains a TextField.
- Click the
TextField to give it focus.
- Close the modal by clicking the outside overlay or pressing
ESC.
- Type some random characters on the keyboard.
- Reopen the same
ModalPane.
- Observation: The characters typed in step 4 appear in the text field.
Reproduction in AtlantaFX Sampler:
- Scenario 1: Press
/ to open the search box. Focus the input field. Close it by pressing ESC or clicking outside. Press / again.
- Result: The search box does not open because the focus is still trapped in the hidden input field.
- Scenario 2: In the "ModalBox" sample, click the button to open the modal, focus the text field, and then close the modal. Type randomly. Open the modal again.
- Result: The input content is visible.
Issue 2: Clicking the overlay mask does not trigger the onClose event
Description: When closing the modal by clicking the gray overlay mask outside the ModalPane, the configured onClose callback is not triggered.
This behavior is inconsistent with closing the modal via the ESC key (or the close button), which correctly triggers onClose. This prevents developers from reliably handling cleanup logic (such as clearing focus or resetting state) in a unified way.
Steps to reproduce:
- Open a
ModalPane with an onClose event handler attached.
- Click the gray overlay/mask area outside the modal to close it.
- Observation: The
onClose event is NOT triggered.
- (Contrast) Open the
ModalPane again and press ESC. The onClose event IS triggered.
Issue 1: Internal TextField focus is not released after ModalPane is hidden
Description: When a text field inside a
ModalPaneacquires focus and the modal is subsequently closed (hidden) by clicking the outside area or pressingESC, the focus is not released from the text field.This results in "focus trapping" on an invisible element:
/) fail to work because the event is consumed by the focused (but hidden) text field.ModalPaneis reopened, the unintended input typed while it was hidden becomes visible.Steps to reproduce:
ModalPanethat contains aTextField.TextFieldto give it focus.ESC.ModalPane.Reproduction in AtlantaFX Sampler:
/to open the search box. Focus the input field. Close it by pressingESCor clicking outside. Press/again.Issue 2: Clicking the overlay mask does not trigger the
onCloseeventDescription: When closing the modal by clicking the gray overlay mask outside the
ModalPane, the configuredonClosecallback is not triggered.This behavior is inconsistent with closing the modal via the
ESCkey (or the close button), which correctly triggersonClose. This prevents developers from reliably handling cleanup logic (such as clearing focus or resetting state) in a unified way.Steps to reproduce:
ModalPanewith anonCloseevent handler attached.onCloseevent is NOT triggered.ModalPaneagain and pressESC. TheonCloseevent IS triggered.