This patch fixes#1251.
The keydown event is faked in mobile chrome because it's not something reliable due to today's virtual keyboards prediction features. Typing a <kbd>C</kbd> character doesn't mean it will be there when user uses autocorrection/autoguessing.
Instead of that, we use now the `keydown` event exclusively for movement features, and `input` event exclusively for content changes in the search input element.
Apart from fixing search in mobile Chrome, it also makes code more readable.
The search input also disables autocompletion since it would be useless and annoying here.
In the case of app icons, those weren't getting the `href` attribute filled.
In the case of search results, those weren't even an `<a>` element.
Fixed in both cases to fix https://github.com/OCA/web/issues/1170.
When the user uses TAB or SHIFT+TAB to navigate in search results, he can trigger a SHIFT-only keydown event without noticing, which would reset the selected result position to the first or last.
It is disturbing, so, to avoid that problem, the re-search is only triggered if the currently pressed key has length=1 or is Backspace, which will skip most keys that are not actually writing a character into the search input, like i.e. "Shift", "Alt", "F4", etc.
In addition to that, to detect if the search results is empty, the `:empty` selector is not trustable because it considers not empty nodes with whitespace-only content. That has been patched too.
This migration includes a full refactoring to make this module more
maintainable. Some things that have changed:
- Removed external libraries.
- Change Less for Scss.
- Reduce ES and XML to the minimal required needs.
- Implement as much features as possible with just Scss.
- Remove copyright from `__init__.py` files.
- Trigger the new hotkeys system from Odoo v12 with `Shift+Alt` instead
of just `Alt`, and restore some good old hotkeys (`E` for "Edit",
`D` for "Discard", and `A` for "Apps menu").
See https://github.com/odoo/odoo/issues/30068 on the matter.
- Control panel breadcrumbs are collapsed into a single backwards icon.
- Add FA icons to most common buttons in control panel.
- Hide text in XS for those buttons, to have a slicker phone experience.
- Lots of gifs in the README!
Before this patch, there was an incompatibility between this addon and l10n_es_toponyms, caused by the lack of wrapping of the special address field that was being added.
Now layout works as expected in that case. In any other case, it seems sensible to wrap inputs so no more weird overflows happen and less chances of needing horizontal scrolling happen.