question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The cursor position is at the start of the field instead of the end of the field after a call to Context.API.ChangeQuery("...") from inside a plugin

See original GitHub issue

Describe the bug/issue I’m developing a plugin (which target both Flow Launcher and Wox using an abstraction layer for both).

At a certain point in parsing the command, I decide to rewrite the current query from “vol +” to “vol change +”. To do that I use PluginInitContext.API.ChangeQuery(“vol change +”)

(Note: I happen to use the same API for both Wox and Flow Launcher)

Expected result:

  • The new query is “vol change +” and the cursor is at the end of the query so any new char typed is inserted at the end of the string

Actual result:

  • The new query is “vol change +” but the cursor is at the start of the query so any new char typed is inserted at the start of the string

Notes:

  • Under Wox, the cursor is at the end of the query as excepteded.
  • While the context is different, the problem may be related to #1070 and/or #1025
  • This context may help in solving the problem of the above issues
  • I haven’t yet looked at Flow Launcher source code about this problem

Your System:

Microsoft Windows [version 10.0.19043.1586]
Flow Launcher version: 1.9.3

Flow Launcher Error Log: No log is generated during this sequence.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ATNewHopecommented, Mar 23, 2022

Can you try this build from pr 1074, see if it does solve the issue: https://ci.appveyor.com/api/buildjobs/vune5b0m6mpf6lpd/artifacts/Output%2FPackages%2FFlow-Launcher-Portable.zip

Nice! It works for me. Thanks!

1reaction
jjw24commented, Mar 20, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

react input cursor moves to the end after update
If the cursor jumps to the end of the field it usually means that your component is remounting. It can happen because of...
Read more >
How to position the cursor/caret after inserted inline ...
Hi! I have written a custom visual plugin which allows a user to click a link to insert an inline content control into...
Read more >
How to check if cursor is at the end of the line?
What is the function to get line length in which cursor exists. Look at the line() function in the API docs. Something like...
Read more >
How to Work With the React Context API
Once that's done, we can import the context and use it to create our provider, which we're calling MyProvider. In it, we initialize...
Read more >
React Context API: A deep dive with examples
The React Context API, introduced in React v.16.3, allows us to pass data through our component trees, giving our components the ability to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found