I’ve got an input in my modal. I’d like it to autofocus when the modal opens. I’ve added the
autofocus attribute and this works the first time the modal is opened in Google Chrome, but not subsequently. It doesn’t seem to work at all in Safari. I haven’t tested other browsers.
As a workaround, I’ve created an attribute directive that focuses the input during
ngAfterViewInit, but this seems like using a sledge hammer to crack a nut (and it could create unexpected behaviour elsewhere.)
Link to minimally-working plunker that reproduces the issue:
Version of Angular, ng-bootstrap, and Bootstrap: