Opened 14 years ago
Last modified 8 years ago
#5777 closed enhancement
popups: move/close when window resized — at Version 13
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.0 |
Keywords: | popup moving place | Cc: | ben hockey |
Blocked By: | Blocking: |
Description (last modified by )
I guess the problem is related to ticket #5776.
Some of the widgets use dijit.popup to show some content attached to the widget, e.g. TimeTextBox shows _TimePicker. When you have the content of the page centered (or right-aligned I guess) resizing the browser window make all the page elements move. But the popups do not move, since they are positioned with:
// In dijit/base/_place.js:155-156 you can read: node.style.left = best.x + "px"; node.style.top = best.y + "px";
In my opinion they should be somehow sticked to the parent widget, so that they move when the parents move.
Maybe some trick with position:relative
would do the job?
Regards, Grzegorz Olędzki
Change History (13)
comment:1 Changed 14 years ago by
Milestone: | → 2.0 |
---|---|
Owner: | set to bill |
Summary: | Popups should be placed relatively to aroundNodes → popups: close when window resized |
comment:3 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.3 → 1.4 |
comment:4 Changed 13 years ago by
I've been experimenting and deliberating over this.
I'm starting to feel uneasy about just closing a popup on resize, as that may be bad for the user, especially if it's a dialog-esque popup and they've typed some data into it.
However, it's hard to reposition the popup for a number of reasons:
- Resizing the viewport may actually make the aroundNode go off screen. This can be for simple cases like a page with a long form, or when there are multiple scrollbars like the ComboBox inside of a BorderContainer pane in themeTester.html
- when you open a popup, the popup API tells the caller where the popup was positioned (top/bottom/left/right). There's no API to notify the caller that the popup was moved.
- sizing: ComboBox typically has a tall drop-down which it resizes (thus adding a scrollbar) when there isn't room to put the whole thing in the viewport. Resizing the browser window means that the drop down needs to be resized too, but there's no API to relay that to the ComboBox code.
comment:5 Changed 13 years ago by
Milestone: | 1.4 → 1.5 |
---|
comment:6 Changed 12 years ago by
Milestone: | 1.5 → 1.6 |
---|
comment:8 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 12 years ago by
comment:10 Changed 12 years ago by
(In [22761]) Temporary fix to ignore spurious onscroll events that occur on IE. The spurious onscroll events were causing Select.html plus ComboBox tests to prematurely close the drop down.
This check in does not completely fix the Select.html test problem since that test has a Select with a tall drop down (taller than the viewport) which causes the whole page to scroll when one of the elements gets focused. That will be fixed in #10631.
Refs #5777 !strict.
comment:11 Changed 11 years ago by
comment:12 Changed 11 years ago by
(In [23866]) Changes related to closing/repositioning popups on scroll / resize:
- Rollback (erase) code to close popups on window resize (refs #5777, fixes #12317) and mouse wheel (refs #12297).
- When possible, don't close popups when the browser window is scrolled using the mouse on the browser scroll bar. Popups still close by clicking anywhere else on the page, including inner scrollbars. Unfortunately on IE6 & 7, clicking the browser scrollbar also still causes popups to close.
- In RTL mode, make place.js set popup.style.right rather than popup.style.left, so that on screen resize (at least in the common case) the popup and the aroundNode stay aligned. (refs #10875)
Background:
- It's often harmful that resizing a window closes the popup; the user may be expanding the window to see all of the popup. Although resizing can cause a reflow, separating the aroundNode from the popup, but often it doesn't. The case of centered/right-aligned elements mentioned in #5777 is an exception.
- Closing popups on scroll is also questionable. Scrolling the main window will scroll the aroundNode and the popup together, so it's counterproductive to close the popup. OTOH, scrolling a <div> will separate the aroundNode from the popup. And for a mousewheel event it's hard to tell whether it's affecting the main window or a nested <div>.
In the future, I'll add code to actually reposition popups when a browser window resize or a scroll has caused the aroundNode to move.
!strict.
comment:13 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Milestone: | 1.6 → future |
Resolution: | fixed |
Status: | closed → reopened |
Summary: | popups: close when window resized → popups: move/close when window resized |
I'd just like to close the popups when the window is resized. See also #4600.