Skip to content
Snippets Groups Projects
Commit ab9fbfb4 authored by qsm-odoo's avatar qsm-odoo
Browse files

[FIX] website: prevent input and datepicker interaction in edit mode


Before this commit, during edit mode, the user was able to interact with
form elements. In 13.0, it was somehow prevented by some JS code by
losing the focus immediatly but it was not enough: if typing quickly the
user was able to type text. But the real problem was the user seeing the
input focused for half a second then not anymore, making him think a bug
occured. Worse, the datepickers of the form snippet were able to be used
entirely during edit mode, making the user think it is possible to
configure a default value (which was not true in 13.0). In following
versions, the bug is indeed worse as it messes up with the default
values configuration. In 14.0, it is apparently possible to type
normally in all of those inputs... although still ignored on save. In
15.0... the 13.0 behavior of losing the focus immediatly is back though.

This commit fixes that via CSS, still allowing a click on the elements
to be considered as a click on the parent, but preventing to focus our
snippet inputs (this fix is limited to our own snippets as stable fix).
Note: the 13.0/15.0 JS code which prevents the focus right now was not
found (if it even exists...) but it would not be ok to remove it in
stable anyway. More investigation and review will be done once this
reaches master.

task-2523496

closes odoo/odoo#84589

X-original-commit: 3e598a80
Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent ac417f28
No related branches found
No related tags found
No related merge requests found
......@@ -256,3 +256,21 @@ body.editor_enable {
}
}
}
// Inputs in editable zones should not be possible to interact with.
// TODO as this was done as a fix in 13.0, this only targets the inputs of
// specific snippets and even targets snippets of other apps (which do not
// declare files for edit mode only). In master it should be refactored to
// target all inputs and/or target specific snippets in their own app.
.editor_enable {
.s_website_form, .s_searchbar_input, .js_subscribe, .s_group, .s_donation_form {
input {
pointer-events: none;
}
}
.s_website_form {
[data-toggle="datetimepicker"], textarea {
pointer-events: none;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment