virtual keyboard bug on Android device when popup
slavanb opened this issue · 4 comments
On all android devices, when I try to enter text in a pop-up window, at this point the virtual keyboard closes on the android.
It is observed in all browsers.
echo \kartik\editable\Editable::widget([
'model' => $model,
'attribute' => 'LESSON_THEMA',
'asPopover' => true,
'size' => 'lg',
'submitOnEnter' => false,
'inputType' => \kartik\editable\Editable::INPUT_TEXTAREA,
'options' => ['class'=>'form-control','rows' => 5],
]);
-
Mobile
-
yii2-editable version: 1.7.7
-
The bug happens consistently across all tested browsers
-
This bug happens when using yii2-editable without other plugins.
fix this problem
in composer.json
"kartik-v/bootstrap-popover-x": "1.4.3"
./composer.phar update
after that clean cache in /backend/web/assets - all to trash
The problem still present. It happens because bootstrap-popover-x.js checks window resize instead of orientationchange event. When virtual keyboard is showing, triggers resize event. So, js code hides our popover (need redraw. it is too easy to re-init popover instead of to recalc its coordinates), popover input loses focus, keyboard hides :) So, we can't use virtual keyboard trying to focus popover input
I tested kartik's demo page via my cellular (perhaps, my code is wrong). It does not work too :(
$(window).resize(function () {
if ($dialog.hasClass('kv-popover-active')) {
// self.hide();
// setTimeout(function () {
// self.show(true);
// }, 50);
self.refreshPosition();
}
});
The code above helped me to solve problem. But i have no idea how to do it better.
This is fixed via this commit as mentioned in kartik-v/bootstrap-popover-x#46