fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

dropdown does not lose focus even if i click outside

Open vashit opened this issue 10 years ago • 5 comments

for all browser except IE, dropdown does not lose focus even if i click outside of dropdown (somewhere in the same window) it collapses only if i click outside the current window.

Expected behavior: as soon as i click outside the dropdown, it should lose focus Reason: currently dropdown collapse is bind to focus out event of window

vashit avatar Nov 07 '16 05:11 vashit

you need to implement onDismiss and remove/hide it.

Example here:

http://codepen.io/dzearing/pen/WovrbX

If you're still having issues, feel free to alter the codepen for the repro. Or if you have a suggestion feel free to re-open this issue with a feature request.

Thanks!

dzearing avatar Nov 07 '16 19:11 dzearing

re-opening as the original bug was that dropdown should also lose focus when clicked anywhere else in the window.

vashit avatar Nov 08 '16 06:11 vashit

Did you try to repro your issue in the codepen?

dzearing avatar Nov 08 '16 07:11 dzearing

Sorry I misunderstood and was thinking ContextualMenu. Here's the Dropdown example:

http://codepen.io/dzearing/pen/xRGXaL

The latest build has this fixed. Can you make sure you're on the latest build?

dzearing avatar Nov 08 '16 07:11 dzearing

i was able to rero this on the demo site: https://fabricreact.azurewebsites.net/fabric-react/master/#/examples/dropdown but not on code-pen. commit da3cd079fe15cdd6263947784385725055e25ef5 seems to be the fix which is not yet reflected for me on the demo site

vashit avatar Nov 08 '16 07:11 vashit