-
Notifications
You must be signed in to change notification settings - Fork 303
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
How to make the dropdown stay left and not follow the cursor #303
Comments
Hi there, thanks for providing this library, I just moved out of react-specific libs because they don't handle certain cases. This lib works very well out of the box for my use cases. Is there any way to get the behavior described here? |
@lsenta Do you want a UI like typeahead.js? If yes, the answer is no. Textcomplete doesn't support such UI now. |
My bad, the description of this issue might not be exactly what I'm looking for. If you try to autocomplete in https://yuku.takahashi.coffee/textcomplete/ you'll see the autocomplete dropdown moves with the cursor as you type. But if you look at the gif on this project's README, https://github.com/yuku/textcomplete/raw/main/docs/images/demo.gif the That's the behavior I'm looking for. You'll see this behavior in github mentions, vscode autocomplete, jetbrain autocomplete, roamresearch autocomplete, etc. |
I understand. When a user inputs, the Probably, it can be implemented as follows. I'll take a closer look later. this.setStrategyId(searchResults[0])
.renderEdge(searchResults, "header")
.renderItems()
.renderEdge(searchResults, "footer")
.activate(0)
if (this.shown && this.options.keepInitPosition) {
// Don't call setOffset if it has already been rendered
// and the option is given.
} else {
this
.show()
.setOffset(cursorOffset)
} |
Hello,
thanks for the great control. I am using it for a text area that is to the far right of my screen. When I start typing, the dropdown moves with the cursor position. When I get closer to the right screen border, the dropdown becomes smaller and smaller.
I already tried "placement: 'absleft'", but that moves it all the way to the left of the screen. I also attempted putting another element just below and using that for 'appendTo'. Did not work either.
I noticed that the script is calculating the left offset in pixels and adding to the element style.
Is there a way to tell it to stay at the start of the text area instead of moving with the cursor?
The text was updated successfully, but these errors were encountered: