Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring rich dropdown elements into focus when opening #281

Merged
merged 2 commits into from
Jul 12, 2016
Merged

Conversation

ajb
Copy link
Contributor

@ajb ajb commented Jun 30, 2016

cf #248

@jrubenoff, I could use your opinion here. (Once you're back!)

Here's a screencast: http://take.ms/hpwPH

@jrubenoff
Copy link
Contributor

What if we just positioned the dropdown menu above the button in these instances, instead of below it?

screen shot 2016-07-11 at 2 01 34 pm

This would more closely replicate the behavior of existing selects, and remove the abrupt / awkward shift in page position that this approach requires.

@ajb
Copy link
Contributor Author

ajb commented Jul 11, 2016

That would be about 100x more complicated to implement. If this is an improvement, we should merge it -- if not, I don't really have any other options. (I worked at this for a while...)

@jrubenoff
Copy link
Contributor

Well, just looked at the original issue, which clarifies things a bit!

So...

  • Like Dropdowns should scroll to current selection #248 depicts, is there any way we can scroll the selected item as close to the top of the list as possible? As it stands, the scrolling behavior seems a little arbitrary.

  • Re: the bottom-of-viewport stuff, what I suggested above is how iOS does it. You can see another manifestation of the same problem in Responsive positioning of dropdowns #129. Right now, it looks like it's a "won't fix" Bootstrap issue (see this, and fat's comment that this might be a perf problem.)

    We should keep thinking about ways to solve this in the future, beyond this issue... it's still pretty annoying for responsive design, and for smaller screens.

  • In the meantime, would it be too expensive to (rapidly) smooth-scroll the window if the dropdown's at the bottom of the viewport? As mentioned, right now it feels a little abrupt.

@ajb
Copy link
Contributor Author

ajb commented Jul 12, 2016

Please look at the implementation. There is no flexibility on how it behaves.

@jrubenoff
Copy link
Contributor

Couldn't you..

  • set the $.scrolltop of .dropdown to li.active a
  • animate the scroll position
  • then focus it?

@ajb
Copy link
Contributor Author

ajb commented Jul 12, 2016

I tried that, but I was having trouble figuring out how to get the correct offset of li.active a. Also, there's no guarantee where it will be positioned once it's .focus()ed.

If you'd like to pair on this, we can try, but I spent a while trying to make this work.

@ajb
Copy link
Contributor Author

ajb commented Jul 12, 2016

In person: we went over my comment above ^^.

@ajb ajb merged commit 5773e75 into master Jul 12, 2016
@ajb ajb deleted the dropdown-scroll branch July 12, 2016 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants