Git Product home page Git Product logo

Comments (9)

hodgef avatar hodgef commented on July 24, 2024 1

Hey @luatnd. I've been trying this out and it seems there's no way to do this. The device's keyboard will appear whenever element.focus() is called. I've tried setting readonly="true" then triggering a .focus() along with event.preventDefault(), but still the device keyboard comes back.

If you find a way to get this use-case to work, do let me know and I'll add it to the docs. Thanks

from simple-keyboard.

luatnd avatar luatnd commented on July 24, 2024

Ah, After read the code I can see caret position is handled but package doesn't have any feature to reflect caret to UI.

from simple-keyboard.

hodgef avatar hodgef commented on July 24, 2024

Hey @luatnd, could you elaborate on what you mean by "reflect caret to UI"? As you have correctly noted, the keyboard just handles caret positioning. There's an option to disable this handling (which reverts to always adding text at the end of the string).

Maybe you mean that simple-keyboard shouldn't take input focus away from the input. In that case you can try setting preventMouseDownDefault to true.

Edit: I'll close the ticket while I wait for more info. Will reopen as soon as you respond so we can continue looking into this.

Thank you,
Francisco Hodge

from simple-keyboard.

luatnd avatar luatnd commented on July 24, 2024

Sorry, I described my problem carelessly.
My case is: I'm using this virtual keyboard on touch devices (mobiles) so users can see both virtual and devices keyboard.
That's why I need to call element.blur() to hide the device keyboard.
For sure, I cannot see the caret.
--> So I asked you.
But after thinking and re-read your code, I know I should forget the caret :(
I could not find a way to hide device keyboard while remaining the caret.
Do you have another workaround?
Anw, thank for your actively supporting.

from simple-keyboard.

luatnd avatar luatnd commented on July 24, 2024

Yes. It's impossible.
Luckily we're running our app via webview so we can ask for help from native code.
Thanks.

from simple-keyboard.

raeffs avatar raeffs commented on July 24, 2024

@hodgef you mentioned that "There's an option to disable this handling (which reverts to always adding text at the end of the string)." How can this be enabled?

from simple-keyboard.

hodgef avatar hodgef commented on July 24, 2024

Hey @raeffs ,

Sorry, I forgot to add this one to the docs. The option is called disableCaretPositioning.
I've just added the docs here: https://simple-keyboard.com/documentation/#disableCaretPositioning

Regards,
Francisco Hodge

from simple-keyboard.

raeffs avatar raeffs commented on July 24, 2024

@hodgef okey, thanks ;)

It seems to be missing in the types too.

from simple-keyboard.

hodgef avatar hodgef commented on July 24, 2024

Hello @raeffs ,

Thanks for the heads up! I've just added the types for this method (^2.13.3).

Regards,
Francisco Hodge

from simple-keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.