MCPcopy Create free account
hub / github.com/AccessKit/accesskit / is_invocable

Method is_invocable

consumer/src/node.rs:653–668  ·  view source on GitHub ↗
(&self, parent_filter: &impl Fn(&Node) -> FilterResult)

Source from the content-addressed store, hash-verified

651 }
652
653 pub fn is_invocable(&self, parent_filter: &impl Fn(&Node) -> FilterResult) -> bool {
654 // A control is "invocable" if it initiates an action when activated but
655 // does not maintain any state. A control that maintains state
656 // when activated would be considered a toggle or expand-collapse
657 // control - these controls are "clickable" but not "invocable".
658 // Similarly, if the action only gives the control keyboard focus,
659 // such as when clicking a text input, the control is not considered
660 // "invocable", as the "invoke" action would be a redundant synonym
661 // for the "set focus" action. The same logic applies to selection.
662 self.is_clickable(parent_filter)
663 && !self.is_text_input()
664 && !matches!(self.role(), Role::Document | Role::Terminal)
665 && !self.supports_toggle()
666 && !self.supports_expand_collapse()
667 && self.is_selected().is_none()
668 }
669
670 pub fn supports_action(
671 &self,

Callers 1

Calls 5

is_clickableMethod · 0.80
is_text_inputMethod · 0.80
supports_toggleMethod · 0.80
is_selectedMethod · 0.45

Tested by

no test coverage detected