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: 5 additions & 5 deletions packages/dom/src/queries/label_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ pub fn _query_all_by_label_text<M: Into<Matcher>>(
let label_list = get_labels(container, &labelled_element, Some(selector.clone()));

for label in &label_list {
if let Some(form_control) = label.form_control.as_ref() {
if matcher(
if let Some(form_control) = label.form_control.as_ref()
&& matcher(
label.content.clone(),
label.form_control.as_deref(),
&text,
match_normalizer.as_ref(),
) {
labelled_elements.push(form_control.clone());
}
)
{
labelled_elements.push(form_control.clone());
}
}

Expand Down
11 changes: 5 additions & 6 deletions packages/dom/src/role_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ static ELEMENT_ROLE_LIST: LazyLock<Vec<ElementRole>> = LazyLock::new(|| {

result.push(ElementRole {
r#match: Box::new(move |element| {
if type_text_index.is_some() {
if let Some(input_element) = element.dyn_ref::<HtmlInputElement>() {
if input_element.type_() != "text" {
return false;
}
}
if type_text_index.is_some()
&& let Some(input_element) = element.dyn_ref::<HtmlInputElement>()
&& input_element.type_() != "text"
{
return false;
}

element.matches(&selector).unwrap_or(false)
Expand Down
22 changes: 11 additions & 11 deletions packages/pretty-format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ fn create_indent(indent: usize) -> String {
pub fn format(val: &JsValue, options: PrettyFormatOptions) -> Result<String, PrettyFormatError> {
validate_options(&options)?;

if let Some(plugins) = &options.plugins {
if let Some(plugin) = find_plugin(plugins, val) {
return Ok(print_plugin(
plugin,
val,
&get_config(options),
"".into(),
0,
vec![],
));
}
if let Some(plugins) = &options.plugins
&& let Some(plugin) = find_plugin(plugins, val)
{
return Ok(print_plugin(
plugin,
val,
&get_config(options),
"".into(),
0,
vec![],
));
}

let basic_result = print_basic_value(
Expand Down
Loading