Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jan 2, 2025

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

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
@robodoo
Copy link
Contributor

robodoo commented Jan 2, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jan 2, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 2, 2025

@C3POdoo C3POdoo added the RD research & development, internal work label Jan 2, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 3, 2025

@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed).

3 similar comments
@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 4, 2025

@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed).

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 5, 2025

@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed).

@fw-bot
Copy link
Contributor Author

fw-bot commented Jan 6, 2025

@ksbh-odoo @bvr-odoo this forward port of #187014 is awaiting action (not merged or closed).

@bvr-odoo
Copy link
Contributor

bvr-odoo commented Jan 7, 2025

@robodoo r+

robodoo pushed a commit that referenced this pull request Jan 7, 2025
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>
@robodoo robodoo added the 18.2 label Jan 7, 2025
@robodoo robodoo closed this Jan 7, 2025
@fw-bot fw-bot deleted the master-16.0-fix-prevent-tab-duplication-ksbh-T9wA-fw branch January 21, 2025 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

18.2 forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants