Skip to content

Commit c1fef18

Browse files
committed
Stacking Elements: Consider <dialog> a stacking element
Ref jquery/jquery-ui#1517 Closes gh-258
1 parent ad42c59 commit c1fef18

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pages/theming/stacking-elements.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
}
77
}</script>
88

9-
Widgets that stack, or move in front of other elements, often present challenges when placed into real world pages. It's usually easy to either change the `z-index` or parent of the stacked element to avoid any collisions on the page. However, jQuery UI needs a generic solution that doesn't require manually playing with `z-index` values. This is accomplished via the `ui-front` class, and usually an accompanying `appendTo` option on stacking widgets.
9+
Widgets that stack, or move in front of other elements, often present challenges when placed into real world pages. It's usually easy to either change the `z-index` or the parent of the stacked element to avoid any collisions on the page. However, jQuery UI needs a generic solution that doesn't require manually playing with `z-index` values. This is accomplished via the `ui-front` class, and usually an accompanying `appendTo` option on stacking widgets.
1010

1111

1212

1313
## The `ui-front` class
1414

15-
The `ui-front` class is very basic. It just sets a static `z-index` value on the element. However, the existence of the class is used to indicate where stacking elements should be appended. This allows us to take advantage of nested stacking contexts, resulting in a default DOM position that works for most use cases.
15+
The `ui-front` class is very basic. It just sets a static `z-index` value on the element. However, the existence of the class is used to indicate that an element is a stacking element, which indicates where additional stacking elements should be appended. This allows us to take advantage of nested stacking contexts, resulting in a default DOM position that works for most use cases.
1616

1717
*Note: When using `ui-front`, you must also set `position` to `relative`, `absolute` or `fixed` in order for the `z-index` to be applied.*
1818

@@ -24,6 +24,8 @@ Any widget that appends a stacking element to the page must use the `ui-front` c
2424

2525
* If a value is provided for the `appendTo` option, then append the stacking element to the specified element.
2626
* If the `appendTo` option is set to `null` (default), then the widget should walk up the DOM from the associated element. For example, when the autocomplete menu is appended to the DOM, the walking starts from the associated input element.
27-
* If an element with the `ui-front` class is found, append to that element.
28-
* If no element with the `ui-front` class is found, append to the body.
27+
* If another stacking element is found, append to that element.
28+
* If no other stacking elements are found, append to the body.
2929
* The stacking element must also have `position` set to `relative`, `absolute`, or `fixed` in order for the `z-index` from the `ui-front` class to be applied. Using [.position()](/position/) will automatically set `position`.
30+
31+
Stacking elements are defined as elements with the `ui-front` class, or any native element that creates a new stacking context. Currently, `<dialog>` is the only native element that is considered a stacking element.

0 commit comments

Comments
 (0)