palantir/blueprint

Add shouldReturnFocusOnClose property to Toaster

开放

#6,018 创建于 2023年3月14日

 (1 条评论) (0 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P3Package: coreType: feature requesthelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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".

贡献者指南