Add `focus` option #497

Open
wants to merge 1 commit into
from

Projects

None yet

2 participants

@kaime
kaime commented Feb 24, 2016

Currently, bootbox is hardcoded to focus first .btn-primary after showing. This can cause a weird scroll when the modal is higher than viewport.

This pull requests adds a new option (focus), which allows you to specify which element should be focused, if any. It defaults to .btn-primary:first, which is current behavior.

If null is passed, no element will be focused after showing the modal.

This should solve #260

@makeusabrew
Owner

Cool; any chance you could add tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment