Sage / carbon

Carbon by Sage | ReactJS UI Component Library
https://carbon.sage.com
Apache License 2.0
277 stars 85 forks source link

Switch element loses focus when loading #6922

Open foxyd-sage opened 2 weeks ago

foxyd-sage commented 2 weeks ago

Description

When the user switches on the button - we send API request with some configuration and at this moment the user losing the focus from this Switch button. So when the element has loading state th element lose the focus on it. Would be usefull if we can handle it and leave the focus on the Switch element.

Reproduction

https://stackblitz.com/edit/parsium-carbon-starter-pyfspy?file=src%2FApp.tsx

Steps to reproduce

1) Click the toggle button 2) The focus losing once the button has Loading status

JIRA ticket numbers (Sage only)

SBS-106424

Suggested solution

No response

Carbon version

138.0.2

Design tokens version

4.34.0

Relevant browsers

Chrome

Relevant OSs

Windows

Additional context

No response

Confidentiality

nicktitchmarsh commented 1 week ago

FE-6792