diff options
| author | Vincent Schippefilt <vsc@odoo.com> | 2018-02-19 15:26:15 +0100 |
|---|---|---|
| committer | Vincent Schippefilt <vsc@odoo.com> | 2018-04-10 09:39:08 +0200 |
| commit | e0924fd01d8ffaf95b677b10ea0a5627b484a7d6 (patch) | |
| tree | f4292d6f97686a0d4376cc42f768c5525bc4c13c /addons/web/static/src/js/views/basic | |
| parent | a4d00a56b640d9da5129e2611667b3f491157ca5 (diff) | |
[IMP] web: keyboard navigation in form view
1. Added the ability to navigate within the List view using UP and
DOWN keys.
2. By defaults, the focus should be set on the search input field.
3. From the search input field, using the DOWN key, the focus goes
to the list
4. From the search input field, using TAB key, the focus goes to the
create button
5. From the create/import buttons, using TAB or DOWN key goes to the
first row of the list, then UP and DOWN keys moves the focus from
item to item in the list.
6. When on a row, hitting ENTER opens the view of that row.
Also in this commit
1. When on the first row, hitting the UP key does nothing
2. When on the last row, hitting the DOWN key does nothing
Not included in this commit
1. Memorize the position on the list when opening an row, than
restoring when going back to that list
2. Navigation on grouped list using the keyboard
Diffstat (limited to 'addons/web/static/src/js/views/basic')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_controller.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_renderer.js | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index 1a87c3433f6..8a9b3713f15 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -121,6 +121,12 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { return []; }, /** + * Gives the focus to the renderer + */ + giveFocus:function() { + this.renderer.giveFocus(); + }, + /** * Returns true iff the given recordID (or the main recordID) is dirty. * * @param {string} [recordID] - default to main recordID diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 4fb7983d00f..55a6c7a6c94 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -136,6 +136,12 @@ var BasicRenderer = AbstractRenderer.extend({ } }, + /** + * Order to focus to be given to the content of the current view + */ + giveFocus:function() { + }, + //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- |
