Skip to content

Commit

Permalink
Fix focusable parameter for Window and Dialog (#225)
Browse files Browse the repository at this point in the history
setFocusable make the root component focusable, not the window itself. For Window we should use setFocusableWindowState
  • Loading branch information
igordmn committed Aug 18, 2022
1 parent b2cc256 commit 0f28953
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fun Dialog(
set(currentTransparent, dialog::isTransparent::set)
set(currentResizable, dialog::setResizable)
set(currentEnabled, dialog::setEnabled)
set(currentFocusable, dialog::setFocusable)
set(currentFocusable, dialog::setFocusableWindowState)
}
if (state.size != appliedState.size) {
dialog.setSizeSafely(state.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fun Window(
set(currentTransparent, window::isTransparent::set)
set(currentResizable, window::setResizable)
set(currentEnabled, window::setEnabled)
set(currentFocusable, window::setFocusable)
set(currentFocusable, window::setFocusableWindowState)
set(currentAlwaysOnTop, window::setAlwaysOnTop)
}
if (state.size != appliedState.size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ class WindowParameterTest {
}

awaitIdle()
assertThat(window?.isFocusable).isFalse()
assertThat(window?.isFocusableWindow).isFalse()

focusable = true
awaitIdle()
assertThat(window?.isFocusable).isTrue()
assertThat(window?.isFocusableWindow).isTrue()

window?.dispatchEvent(WindowEvent(window, WindowEvent.WINDOW_CLOSING))
}
Expand Down

0 comments on commit 0f28953

Please sign in to comment.