odoo/odoo#192169

Created by fw-bot
Merged at 51a005f51cc97c2abe3b45005346a02b7756c840

Statuses:

label
odoo-dev:master-16.0-fix-prevent-tab-duplication-ksbh-T9wA-fw
head
305f31b7397f7a3ff03faae0e0b3be5f99b27f18
merged
10 months ago by Website, Benjamin Vray (bvr)
odoo/odoo
16.0 #187014
17.0 #191945
saas-17.2 #192142
saas-17.4 #192144
18.0 #192147
saas-18.1 #192157
saas-18.2
saas-18.3
saas-18.4
19.0
master #192169

[FW][FIX] web_editor, website: prevent tab duplication

Steps To Reproduce:
-> Go to Edit mode.
-> Drag & Drop Tabs Snippet.
-> Click in middle of tab's text and press "Enter".
-> Tab is split and and new Tab is created.

Issue Reason:
As tab's element fails isUnbreakable() check for Keydown(Enter) event
which makes it possible to split the element. And issue is not specific
to Tab snippet but in other snippets where anchor tag and elements with
btn class or role attribute is button.

Solution:
By modifying checks in isUnbreakable() for handling elements with anchor tags and elements with btn class or role attribute is button.

This PR solves the issue of tab duplication in Tab Snippet and few snippets in which there is already button and the said behavior is observed are : Cover , Text - Image , Image - Text, Carousel, Donate Now ( Button ) where anchor tag and elements with 'btn' class or role attribute is 'button', in Masonry and Carousel snippet which adds button
through Add Element option and also when we add a button using /button command in any snippets.

task-4316648

Forward-Port-Of: #191945
Forward-Port-Of: #187014