Is there a way to make the button focused when active? #27251
-
Like how with the Switch, checked determines whether it's checked or not |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @maralihart is the ToggleButton component what you're looking for? If not, could you give some more details about what you're asking for; possibly example code with a description of how you would expect it to work? |
Beta Was this translation helpful? Give feedback.
-
```
const [active, setActive] = useState(true)
return (<Button active={active}>Content stays focused even when user stops
clicking</Button>)
```
Expected view:
Screen Shot 2023-03-27 at 9.25.43 AM.png
<https://mail.google.com/mail/u/0?ui=2&ik=ce3ac29e50&attid=0.1&permmsgid=msg-a:r-2219850335160813928&view=att&disp=safe&realattid=f_lfr1jxdy0>
(8K)
<https://mail.google.com/mail/u/0?ui=2&ik=ce3ac29e50&attid=0.1&permmsgid=msg-a:r-2219850335160813928&view=att&disp=safe&realattid=f_lfr1jxdy0>
…On Mon, Mar 27, 2023 at 1:04 AM Ben Howell ***@***.***> wrote:
Hi @maralihart <https://github.com/maralihart> is the ToggleButton
<https://react.fluentui.dev/?path=/docs/components-button-togglebutton--default>
component what you're looking for? If not, could you give some more details
about what you're asking for; possibly example code with a description of
how you would expect it to work?
—
Reply to this email directly, view it on GitHub
<#27251 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKECPH3Z4FJVEVMT4TE2DNTW6FCZXANCNFSM6AAAAAAV7AYS5Y>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I'm not able to access the screenshot you linked. But based on the code you pasted, ToggleButton sounds like what you want. The prop for active is called |
Beta Was this translation helpful? Give feedback.
I'm not able to access the screenshot you linked. But based on the code you pasted, ToggleButton sounds like what you want. The prop for active is called
checked
.