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

QT Webkit 5.2 (widget) Caret always at the beginning #269

Closed
nachten opened this issue May 10, 2014 · 2 comments
Closed

QT Webkit 5.2 (widget) Caret always at the beginning #269

nachten opened this issue May 10, 2014 · 2 comments

Comments

@nachten
Copy link

nachten commented May 10, 2014

Hi Mottie,

Love your work i only have one problem, i'm building an web-based embedded application and i'm using your keyboard for data entry for e.g. name of the device.

Everything works as it should work when i connect with my local machine to the embedded browser's web server. But when i open the keyboard on the embedded device itself (which uses QT webkit 5.2 browser) all characters that i enter are added to the beginning of the string. for example when i type "Hallo" it says "ollaH"

This is my simple implementation of the keyboard:

$('#box1').keyboard({
            layout: 'custom',
            customLayout: {
                'default': [
                    '1 2 3 4 5 6 7 8 9 0 - = {bksp}',
                    'a b c d e f g h i j [ ] \\',
                    'k l m n o p q r s ; \' ',
                    '{shift} t u v w x y z , . / {shift}',
                    '{clear} {space} {clear}'
                ],
                'shift': [
                    '! @ # $ % ^ & * ( ) _ + {bksp}',
                    'A B C D E F G H I J { } |',
                    'K L M N O P Q R S : "',
                    '{shift} T U V W X Y Z < > ? {shift}',
                    '{clear} {space} {clear}'
                ]
            },
            display: {
                'bksp': 'Backspace',
                'clear': 'Clear'
            },
            position: {
                of: $('#keyboard')
            },
            usePreview: false,
            alwaysOpen: false,
            stayOpen: true,
            autoAccept: true,
            useCombos: false,
            change: function (event, keyboard, element) {
               // always trigger change event to let knockout obserable is changed
                $(element).change(); 
            }
        });
@Mottie
Copy link
Owner

Mottie commented May 10, 2014

Hi @MakanMakan83!

It sounds like you might be using an input that doesn't support the caret position - see #241. Or, you might be using a content editable element, which this plugin does not yet support caret positioning within.

If neither of the above is the case, then there is a known issue in Safari (at least the last supported windows version of Safari), where a readonly input would not support caret positioning. If this is the case, maybe you can try the mod suggested by @raduanastase in issue #105.

If none of the suggestions above help, then please provide a demo of this issue; you can modify this demo.

@nachten
Copy link
Author

nachten commented May 12, 2014

Hi Mottie,

The modification suggested by @raduanastase did the trick for me ! Thank you very much!

@nachten nachten closed this as completed May 12, 2014
Mottie added a commit that referenced this issue Oct 1, 2014
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