palantir/blueprint

Add shouldReturnFocusOnClose property to Toaster

Open

#6018 aperta il 14 mar 2023

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (2167 fork)batch import
P3Package: coreType: feature requesthelp wanted

Metriche repository

Star
 (20.263 star)
Metriche merge PR
 (Merge medio 43g 10h) (27 PR mergiate in 30 g)

Descrizione

I see that in this ticket #5032 there was removed a feature of returning focus to previously focused element when toaster is closed. But actually I need this for my case. Could the property "shouldReturnFocusOnClose " be added to Toaster, so I developer could deside wether they want or not focus to be returned to previous active element? So it would be like that toaster.show({ message: message, shouldReturnFocusOnClose: true })

To do this, just a simple change need to be done. "render" function in "toaster.tsx" should pass this property to Overlay's shouldReturnFocusOnClose; instead of setting it to "false".

Guida contributor