Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/utils/src/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ pub fn is_table_element(element: &Element) -> bool {
["table", "td", "th"].into_iter().any(|s| node_name == s)
}

pub fn is_top_layer(element: &Element) -> bool {
[":popover-open", ":modal"]
.into_iter()
.any(|selector| element.matches(selector).unwrap_or(false))
}

const WILL_CHANGE_VALUES: [&str; 3] = ["transform", "perspective", "filter"];
const CONTAIN_VALUES: [&str; 4] = ["paint", "layout", "strict", "content"];

Expand Down Expand Up @@ -197,6 +203,10 @@ pub fn get_containing_block(element: &Element) -> Option<HtmlElement> {

while !is_last_traversable_node(&current_node) {
if let Ok(element) = current_node.dyn_into::<HtmlElement>() {
if is_top_layer(&element) {
return None;
}

if is_containing_block(&element) {
return Some(element);
}
Expand Down
2 changes: 1 addition & 1 deletion upstream.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[releases]
core = "1.6.2"
dom = "1.6.5"
utils = "0.2.2"
utils = "0.2.3"
vue = "1.0.6"