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

Make suggest-box smarter about placement on the screen #14

Merged
merged 3 commits into from
Nov 16, 2016

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Nov 16, 2016

These changes make suggest-box more useful when the textarea is close to the bottom and/or right of the viewport.

  • If the text cursor is in the bottom half of the viewport, pop up the menu above the cursor instead of below it.
  • If the menu is going to be hidden by the right of the viewport, try to move the menu towards the left to bring it into view.
  • Update examples to make it easier to test these conditions

Move the box to the left to prevent it from being overflowing the
viewport on the right. Don't move it too far that it overflows the
viewport on the left. Make this adjustment every time the box updates
its options.
- Fill textarea with newlines to make it quicker to test completion
  towards the bottom of the viewport.
- Add a checkbox to toggle right-alignment, to make it easier to test
  completion towards the right of the viewport.
@pfrazee
Copy link
Owner

pfrazee commented Nov 16, 2016

I don't have time to test, if you're confident this is 👍 I'll do a blind merge

@clehner
Copy link
Contributor Author

clehner commented Nov 16, 2016 via email

@pfrazee
Copy link
Owner

pfrazee commented Nov 16, 2016

Nah I can publish

@pfrazee pfrazee merged commit 4e73b49 into pfrazee:master Nov 16, 2016
@pfrazee
Copy link
Owner

pfrazee commented Nov 16, 2016

Published 2.2.3

@clehner
Copy link
Contributor Author

clehner commented Nov 16, 2016 via email

@clehner clehner deleted the stay-in-viewport branch November 17, 2016 21:38
@dominictarr
Copy link
Contributor

@pfrazee what I eventually figured out is always be adding people because one day you won't care about the module any more, and by then it will be hard to find someone to take it over.

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.

3 participants