-
Notifications
You must be signed in to change notification settings - Fork 723
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
Virtual keyboard does not appear below cell when there are multiple Handsontable tables on page #523
Comments
Hi @shivrajsa! The problem appears to be that the Demofunction keyboard() {
var $input = $('.handsontableInput');
// initialize keyboard if not already initialized
if (!$input.getkeyboard()) {
$input.keyboard({
usePreview: false,
layout: 'num'
});
}
// open the keyboard
$input.getkeyboard().reveal();
} I ended up making the following changes to the demo:
|
Thank you @Mottie . Here is detail scenario Click on the cell of first table |
Ahh, you are correct. Sorry about that!... I discovered that there was a new function keyboard() {
var $input = $(':focus');
if ($input.length) {
if (!$input.hasClass('.ui-keyboard-input')) {
$input.keyboard({
usePreview: false,
initialFocus: false,
layout: 'num'
});
}
$input.getkeyboard().reveal();
}
} |
Thank you @Mottie . It's working perfectly. Thanks a ton for this wonderful library. |
Hi @Mottie |
Weird! It looks like we need to make sure the last keyboard is closed before revealing the next. If you update the code as follows, it will behave (demo) var lastInput;
function keyboard() {
var kb,
$input = $(':focus');
if ($input.length) {
lastInput = $input;
// close the last keyboard
kb = lastInput.getkeyboard();
if (kb) {
kb.close(true);
}
if (!$input.hasClass('.ui-keyboard-input')) {
$input.keyboard({
usePreview: false,
initialFocus: false,
layout: 'num'
});
}
$input.getkeyboard().reveal();
}
} |
Thanks again @Mottie , it is working. |
Sorry for not responding earlier... I got back from vacation last week and didn't get a chance to follow up. Has this issue been resolved? |
@Mottie This is issue is still there, it works only when we set |
@Mottie, thanks for your guidance. I have a requirement to use number and character keyboard for different cell in a single application. I am using jquery keyboard js for achieving this. Using your code I am capable of passing the layout (numc, qwertyc) but unable to change the layout. Entire application is based on html and js.
|
Hi @kapurKK! Instead of closing and reopening the keyboard, use the |
Description
I am using Keyboard library to enter inputs in the table cells created using https://github.com/handsontable/handsontable . I call keyboard on 'afterSelectionEnd' on text editor element which has class 'handsontableInput' and it appears just below cell.
Here is code
Code of Keyboard
function keyboard()
{
$('.handsontableInput').keyboard
({
layout: 'custom',
customLayout: {
'default' : [
//keys
],
},
})
.addTyping()
.getkeyboard().reveal();
}
afterSelectionEnd : function (instance,col,row,td){
this.getActiveEditor().beginEditing();
keyboard();
},
Please refer jsfiddle
When I have single table on page, it works perfectly.
But when there are multiple tables on page, result is different
Steps to reproduce
Click on the cell of first table, keyboard appears below cell which is good
Click on the cell of second table.
Result : keyboard appears in left top of page and value in preview is previously selected cell's value
Again click in the same cell of second table
Result : Keyboard appears just below cell which is good
Expected behavior : When user clicks on cell of second table first time ( step 2 ), it should appear immediately below it.
Please guide to solve this problem.
I have posted same issue on Handsontable and on Stackoverflow
The text was updated successfully, but these errors were encountered: