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

Prevent autocomplete to change position (set fix position) #152

Open
teilzeitgeist opened this issue May 2, 2019 · 8 comments
Open

Prevent autocomplete to change position (set fix position) #152

teilzeitgeist opened this issue May 2, 2019 · 8 comments

Comments

@teilzeitgeist
Copy link
Contributor

teilzeitgeist commented May 2, 2019

Is there a way to prevent the autocomplete opening at the top of the textarea?

Because on the one hand the change is annoying and on the other it's in my case buggy:
bug

@jukben
Copy link
Collaborator

jukben commented May 2, 2019

Have you tried to play with boundariesElement prop? Maybe it would be good to allow false option to disable it.

@teilzeitgeist
Copy link
Contributor Author

teilzeitgeist commented May 2, 2019

Yeah, but unfortunately boundariesElement does not work with (because the autocomplete have to be inside the boundariesElement) or without renderToBody (same behavior you can see in the GIF).

So ... an additional prop will be great!

For example like:
autocompletePostionX: auto | left | right
autocompletePostionY: auto | top | bottom

@jukben
Copy link
Collaborator

jukben commented May 2, 2019

Yeah, agree, more like

autocompletePostion={{
	x: "auto | left | right",
	y: "auto | top | bottom"
}}

defaults to auto

What do you think?

@teilzeitgeist
Copy link
Contributor Author

teilzeitgeist commented May 2, 2019

Sounds perfect to me 😎

@jukben
Copy link
Collaborator

jukben commented May 2, 2019

I can try tackle it on weekend, but if you have some time for it, you have green light!

@teilzeitgeist
Copy link
Contributor Author

teilzeitgeist commented May 8, 2019

Sounds great!

I had another case in which the autocomplete has the wrong position (renderToBody is true):
image
(The bottom of the image is the bottom of the browser window)

Maybe the calculation of the autocomplete position with the new renderToBody prop is not correct.

@jukben
Copy link
Collaborator

jukben commented May 8, 2019

Ah, sorry about it. I would be great to revisit it then. Although, I think that the proposed prop autocompletePostion makes sense anyway.

@teilzeitgeist
Copy link
Contributor Author

The wrong calculation of the autcomplete position was my bad 🤦‍♂ .rta__autocomplete was set to display: none; by default ... so the dropdownBounds variable was empty. Now it works.

Anyway the autocompletePostion prop would be great 👍

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

No branches or pull requests

2 participants