bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Autofocus is not working in modals

Open suvjunmd opened this issue 10 years ago • 7 comments

Bug description:

Autofocus is not working in modals. The problem appeared in version 2.2.0, and is missing in 2.1.3.

Link to minimally-working plunker that reproduces the issue:

https://plnkr.co/edit/lnaWCwMQoD0qamWyEhD2?p=preview

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.8 UIBS: 2.2.0 Bootstrap: 3.3.7

suvjunmd avatar Oct 13 '16 22:10 suvjunmd

Can confirm--I had the same problem with 2.2.0. Changed to 2.1.3 and autofocus now works.

motohead400 avatar Nov 01 '16 18:11 motohead400

Same here.

nstuyvesant avatar Nov 13 '16 21:11 nstuyvesant

Sorry - just a clarification... I went back to 2.1.4 (not 2.1.3) from 2.2.0 to resolve the issue.

nstuyvesant avatar Nov 13 '16 21:11 nstuyvesant

I have noticed and issue which probably relatives to this. But notice in 2.2.0 the modal automatically focuses on the first tab-able element. This did not occur in 2.1.4.

brion-fuller avatar Nov 14 '16 15:11 brion-fuller

Seems that the focus goes to the close button (which probably is the first tab-able element). Perhaps this was related to the change to make the dialogs more accessible? See the change on https://github.com/angular-ui/bootstrap/commit/f9f7e02 - src/modal/modal.js line 649 (newly added).

nstuyvesant avatar Nov 30 '16 23:11 nstuyvesant

It appears this was fixed in #6295

dgsmith2 avatar Jan 05 '17 15:01 dgsmith2

Fixed in 2.3.1

suvjunmd avatar Feb 04 '17 18:02 suvjunmd