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

В мобильной версии .ce-toolbar не скрывается при наборе в google chrome android #1022

Open
japanes opened this issue Jan 27, 2020 · 2 comments

Comments

@japanes
Copy link

japanes commented Jan 27, 2020

На компе в мобильной версии при наборе текста тулбар скрывается, как положено, а вот на мобильных устройствах - нет.

Тестировали в хроме на Xiaomi и Meizu

Подключаю файл editor.js из этой папки: https://github.com/codex-team/editor.js/tree/master/dist

@gohabereg
Copy link
Member

Should be tested with the current version

@DragorWW
Copy link

DragorWW commented Sep 10, 2020

I found it also and start reading about this problem. Android return for any key keyCode always 229, and editor.js check it incorrect

You can find the problem in

if (_.isPrintableKey(event.keyCode)) {

public beforeKeydownProcessing(event: KeyboardEvent): void {
/**
* Do not close Toolbox on Tabs or on Enter with opened Toolbox
*/
if (!this.needToolbarClosing(event)) {
return;
}
/**
* When user type something:
* - close Toolbar
* - close Conversion Toolbar
* - clear block highlighting
*/
if (_.isPrintableKey(event.keyCode)) {
this.Editor.Toolbar.close();
this.Editor.ConversionToolbar.close();
/**
* Allow to use shortcuts with selected blocks
*
* @type {boolean}
*/
const isShortcut = event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;
if (!isShortcut) {
this.Editor.BlockManager.clearFocused();
this.Editor.BlockSelection.clearSelection(event);
}
}
}

Steps:

  • start a new paragraph
  • start type
  • editor.js: check symbols
  • android return for any key keyCode always 229
  • editor.js: isPrintableKey return false
  • BUG: editor panel didn't close.

Read more:

@gohabereg simple solution add 229 in isPrintableKey ^)

Or you can check e.target.innerText, after fire event, in innerText, we can get a real text.

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

3 participants