Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent dropdown content #1292

Open
renintw opened this issue Apr 23, 2024 · 5 comments
Open

Inconsistent dropdown content #1292

renintw opened this issue Apr 23, 2024 · 5 comments
Labels
NextGen Events [Priority] Low [Type] Bug [Type] Good First Issue Straightforward, self-contained, doesn't require deep knowledge of codebase

Comments

@renintw
Copy link
Contributor

renintw commented Apr 23, 2024

Describe the bug

Based on other dropdowns and other latest themes, the title shouldn't be there inside the dropdown.

Expected behavior

Remove the text 'Format'.

Screenshots / Screencasts

Screenshot 2024-04-23 at 13 09 53

Screenshot 2024-04-23 at 13 10 01

Screenshot 2024-04-23 at 13 13 09

@renintw renintw added [Type] Bug [Type] Good First Issue Straightforward, self-contained, doesn't require deep knowledge of codebase NextGen Events [Priority] Low labels Apr 23, 2024
@ryelle
Copy link
Contributor

ryelle commented Apr 23, 2024

It looks like "Format" is a single-select, which intentionally has a different look/behavior to it — the visible title and lack of clear button (#1293) are intentional here. See WordPress/pattern-directory#648 (comment). You can see the same behavior on Showcase & Patterns:

@renintw
Copy link
Contributor Author

renintw commented Apr 24, 2024

Thank you for sharing the rationale behind this! Feel that a single-select isn't suitable here because sorting doesn't filter out content, yet the Format reduces the visible content. Users would likely want to clear the filter. Or alternatively, like on Patterns, we could also add an "All" option and set it as the default.

@pkevan
Copy link
Contributor

pkevan commented Apr 24, 2024

Thank you for sharing the rationale behind this! Feel that a single-select isn't suitable here because sorting doesn't filter out content, yet the Format reduces the visible content. Users would likely want to clear the filter. Or alternatively, like on Patterns, we could also add an "All" option and set it as the default.

I was just about to comment to say the same thing 😄

@pkevan
Copy link
Contributor

pkevan commented Apr 24, 2024

@ryelle
Copy link
Contributor

ryelle commented Apr 24, 2024

Yep, these options are set up here:

function get_format_type_options( array $options ): array {
$facets = get_query_var_facets();
$selected = $facets['format'] ?? array();
$count = count( $selected );
$label = __( 'Format', 'wporg' );
if ( $count > 0 ) {
$label = sprintf(
/* translators: The dropdown label for filtering, %s is the selected term count. */
_n( 'Format <span>%s</span>', 'Format <span>%s</span>', $count, 'wporg' ),
$count
);
}
return array(
'label' => $label,
'title' => __( 'Format', 'wporg' ),
'key' => 'format_type',
'action' => build_form_action_url(),
'options' => array(
'online' => 'Online',
'in-person' => 'In Person',
),
'selected' => $selected,
);
}

So you can add an "All" option there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NextGen Events [Priority] Low [Type] Bug [Type] Good First Issue Straightforward, self-contained, doesn't require deep knowledge of codebase
Projects
Status: 📋 To do
Development

No branches or pull requests

3 participants