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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the ability to have a button in the Button's endIcon #654

Open
gnapse opened this issue May 10, 2022 · 1 comment
Open

Provide the ability to have a button in the Button's endIcon #654

gnapse opened this issue May 10, 2022 · 1 comment

Comments

@gnapse
Copy link
Contributor

gnapse commented May 10, 2022

馃殌 Feature request

Motivation

We have the need, from some designs in Todoist's new task details view, to give the impression that there's a button inside another button. Specifically, to have an icon-button in the context of where the endIcon of a Button would appear:

Example

CleanShot.2022-05-09.at.21.48.25.mp4

Problems that this would solve

We're currently achieving this in the short term using a CSS hack to show the endIcon only when the button is hovered or its focus is visible. Then we provide a endIcon={<SvgComponent onClick={鈥 />}. But this is ignoring two larger issues:

  1. The inner icon is not really a button, so it is not accessible.
  2. Even if we made it a button (e.g. endIcon={<button type="button"><svg /></button>}), it would be incorrect markup to have a button inside another button.

Possible implementations

We would need a new component that provides an outer box containing the two buttons, but giving the impression that the main button fills this entire box, while the icon-only button sits also inside this outer bot, but outside the first button.

We already do something like this in Todoist's LabelPill component (closed source, but we may open-source a more generic version of it in the process of doing this work).

@frankieyan
Copy link
Member

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

No branches or pull requests

2 participants