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

Make icons change layout too [#1911] #1912

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

genehack
Copy link
Contributor

Description of proposed changes

This PR adds wrapping <span>s to the grid/full buttons in the layout sub-panel, so clicking the icons changes the layout, just like clicking the words.

Related issue(s)

Closes #1911

Checklist

@nextstrain-bot nextstrain-bot temporarily deployed to auspice-make-grid-full--twbgmz November 20, 2024 00:32 Inactive
Comment on lines +37 to +40
<PanelsFullIcon width={22} selected={this.props.panelLayout === "full"}/>
<SidebarButton selected={this.props.panelLayout === "full"}>
<ButtonText>{t("sidebar:full")}</ButtonText>
</SidebarButton>
Copy link
Member

@victorlin victorlin Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit)

A button nested in a clickable span is presented as two separate selectable items to a screen reader (or Vimium in my case). This is what I see on the PR review app:

image

By placing the icon within the button instead (and adjusting styles), the same desired effect can be achieved while maintaining a single selectable item:

image

<SidebarButton
  selected={this.props.panelLayout === "full"}
  style={{cursor: "pointer"}}
  onClick={}
>
  <PanelsFullIcon width={22} selected={this.props.panelLayout === "full"}/>
  <ButtonText>{t("sidebar:full")}</ButtonText>
</SidebarButton>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By placing the icon within the button instead

Yeah, I tried that, the styling got janky. I will look at it again tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Grid" and "Full" icons are not click targets, only the text responds to clicks
3 participants