-
Notifications
You must be signed in to change notification settings - Fork 30k
[FW][FIX] web_editor, website: prevent tab duplication #192169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FW][FIX] web_editor, website: prevent tab duplication #192169
Conversation
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 commit 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 X-original-commit: 15ef84b
@ksbh-odoo @bvr-odoo this PR targets master and is the last of the forward-port chain containing:
To merge the full chain, use
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed). |
3 similar comments
@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed). |
@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed). |
@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed). |
@robodoo r+ |
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 commit 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 closes #192169 X-original-commit: 15ef84b Signed-off-by: Keval Sitansh Bhatt (ksbh) <ksbh@odoo.com> Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
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 forKeydown
(Enter) eventwhich makes it possible to split the element. And issue is not specific
to Tab snippet but in other snippets where
anchor tag
and elements withbtn
class or role attribute isbutton
.Solution:
By modifying checks in
isUnbreakable()
for handling elements withanchor tags
and elements withbtn
class or role attribute isbutton
.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', inMasonry
andCarousel
snippet which adds buttonthrough
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