Showing posts with label focus. Show all posts
Showing posts with label focus. Show all posts

Thursday, February 13, 2014

Retaining Scroll Position With Dialogs

If you set the height of a jQuery UI dialog widget, the content will scroll vertically. This is the expected result — the .ui-dialog-content div sets the overflow CSS property to auto. However, issues take place when you have multiple dialogs, and content that scrolls inside each. Because of the way focusing works, the vertical scroll bar moves back to the top, whenever the dialog loses focus. Ideally, the user would expect the scroll bar to retain it's position, no matter which dialog has the focus.

Monday, January 13, 2014

Remove Dialog Close Button Focus

When a jQuery UI dialog widget is first opened, it gains the focus of the page. This makes sense, given that most of the time, the dialog opening is the result of the user performing some action, such as clicking a button. The idea is that the dialog probably has some other element in it that needs the attention of the user, like, a text input. It's nice when the user is able to just open the dialog, then continue typing. But perhaps you don't want this behavior.