Skip to content

Commit

Permalink
check is_hidden should use computed style
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Sep 2, 2023
1 parent 064912c commit 1742d17
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,7 @@ impl AppState {
pub fn is_hidden(&self, id: Id) -> bool {
self.view_states
.get(&id)
// TODO: this unwrap_or is wrong. The style might not specify it, but the underlying view style can
.map(|s| s.style.display.unwrap_or(Display::Flex) == Display::None)
.map(|s| s.computed_style.display == Display::None)
.unwrap_or(false)
}

Expand Down Expand Up @@ -626,10 +625,6 @@ impl<'a> EventCx<'a> {
self.app_state.update_focus(id, keyboard_navigation);
}

pub fn get_style(&self, id: Id) -> Option<&Style> {
self.app_state.view_states.get(&id).map(|s| &s.style)
}

pub fn get_computed_style(&self, id: Id) -> Option<&ComputedStyle> {
self.app_state
.view_states
Expand Down

0 comments on commit 1742d17

Please sign in to comment.