Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve ContentDialog's response to the InputPane
Fixes #1149 and #910 When the input pane shows, the ContentDialog's response was to maintain its top/left position and to shrink its height as much as needed to avoid being occluded by the input pane. This behavior resulted in a bug where, if the dialog's top/left was close to the center of the screen, the dialog could become very short when it resized to get out of the way of the input pane (#1149). To fix this, the new way the ContentDialog responds to the input pane is: - If the dialog will not be occluded by the input pane, then the dialog maintains its current size and position. - If the dialog will be occluded by the input pane, the dialog lays itself out using its normal layout rules but it does so in the unoccluded portion of the window (visible document) rather than in the whole window. There was another bug (#910) where the ContentDialog would become horizontally off center if the window was resized while the input pane was showing. This is now fixed because the ContentDialog uses its normal layout rules even when the input pane is showing. Other changes: - Switiched from .focus() to .scrollIntoView() for keeping the focused element in view while resizing the dialog to get out of the input pane's way. The motivation for this change was that calling .focus() on document.activeElement no longer causes the element to scroll into view in Edge. - When the ContentDialog is shown, put focus on the root element of the dialog rather than on the first focusable element within the dialog's content area. The motivation for this change is that .scrollIntoView() is more aggressive about scrolling than .focus() was -- it scrolls the element to the top of its scroller even if that element was already in view. This results in a poor experience when showing the dialog and the first focusable element in the content area is a textfield -- the user will never have the chance to see the content at the top of the dialog because the dialog would immediately scroll it off screen. Order of events: - Dialog shows and puts focus on the first focusable element (assume it's a textfield) in the content area - Input pane shows - Dialog resizes - Dialog calls .scrollIntView() on the textfield to keep it in view during the resize thus scrolling the dialog's topmost content off the screen
- Loading branch information
Adam Comella
committed
Aug 15, 2015
1 parent
30eabf1
commit f4a93a5
Showing
4 changed files
with
144 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters