Comments (9)
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.
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.
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.
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.
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.
@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.
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.
@hodgef okey, thanks ;)
It seems to be missing in the types too.
from simple-keyboard.
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)
- Add icons or images to buttons HOT 1
- your web is not opened HOT 1
- Prevent showing system keyboard on tablets HOT 3
- Support for mouse element HOT 2
- Japanese Flick Input (Mobile) HOT 3
- excludeFromLayout doesnt work HOT 2
- can i use in vue3? HOT 1
- Keyboard button not showing with tailwind HOT 2
- Not responsive on mobile HOT 1
- CSS partialy Apply HOT 1
- BackSpace Issue HOT 1
- need more layers (right alt) HOT 2
- Button Hold : Allow additional keys via options HOT 6
- `layoutCandidates` is not case sensitive HOT 1
- When simple-keyboard is used with accessibility voice over turned on, hitting q enters 1 in input HOT 1
- Simple-keyboard Not Rendering HOT 2
- When set layoutCandidatesPageSize = 15, There is an issue with the background color of the candidate box
- Not displaying keyboard outside app.component HOT 1
- Virtual Keyboard, keys are coming all white HOT 1
- Can this component be dragged by the mouse motor? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-keyboard.