[FIX] web: less bounce edit form button
Before this commit, the edit button in form view bounced on any click. Now, the button bounces only when clicking in the area of a field or its label. closes odoo/odoo#96784 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -31,8 +31,8 @@ export class FormRenderer extends Component {
|
||||
this.compileParams
|
||||
);
|
||||
useSubEnv({ model: record.model });
|
||||
useBounceButton(useRef("compiled_view_root"), () => {
|
||||
return !record.isInEdition;
|
||||
useBounceButton(useRef("compiled_view_root"), (target) => {
|
||||
return !record.isInEdition && !!target.closest(".oe_title, .o_inner_group");
|
||||
});
|
||||
this.uiService = useService('ui');
|
||||
this.onResize = useDebounced(this.render, 200);
|
||||
|
||||
@@ -9131,11 +9131,17 @@ QUnit.module("Views", (hooks) => {
|
||||
<div class="oe_title">
|
||||
<field name="display_name"/>
|
||||
</div>
|
||||
<notebook>
|
||||
<page name="a" string="A"></page>
|
||||
</notebook>
|
||||
</form>`,
|
||||
resId: 1,
|
||||
});
|
||||
|
||||
// in readonly
|
||||
await click(target.querySelector(".nav-tabs .nav-item"));
|
||||
assert.containsNone(target, ".o_catch_attention");
|
||||
|
||||
await click(target.querySelector("div.oe_title"));
|
||||
assert.hasClass(target.querySelector(".o_form_button_edit"), "o_catch_attention");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user