Skip to content

Commit

Permalink
feat: add option for restoreFocusOnClose to the demo
Browse files Browse the repository at this point in the history
  • Loading branch information
bwajtr committed Jan 9, 2024
1 parent 1bbf6cf commit 0c358f8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private Component createOptionsPane() {
layout.add(createCloseOnScrollOption());
layout.add(createIgnoreTargetClickOption());
layout.add(createFocusTrapOption());
layout.add(createRestoreFocusOnCloseOption());
layout.add(createPointerArrowThemeOption());
layout.add(createHighlightTargetOption());
layout.add(createPopupAlignmentOption());
Expand All @@ -131,6 +132,14 @@ private Component createOptionsPane() {
return layout;
}

private Component createRestoreFocusOnCloseOption() {
popup.setRestoreFocusOnClose(true);
Checkbox option = new Checkbox("Restore focus on close");
option.addValueChangeListener(event -> popup.setRestoreFocusOnClose(event.getValue()));
option.setValue(true);
return option;
}

private Component createScrollTargetIntoViewOption() {
popup.setScrollTargetIntoView(false);
Checkbox option = new Checkbox("Scroll target into view on popup open");
Expand Down

0 comments on commit 0c358f8

Please sign in to comment.