Skip to content
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

Editor: Changing the header on one editor will change the header on another editor #1232

Closed
xqses opened this issue Feb 8, 2022 · 4 comments
Assignees
Labels
team: homepages Issues for the homepages team type: bug 🐛 [2] Velocity rating (Fibonacci)

Comments

@xqses
Copy link

xqses commented Feb 8, 2022

Describe the bug
If we have two widgets with editors in the same homepage, changing the header format in the second widget will change the header format in the first widget.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://main-enterprise.demo.design.infor.com/components/editor/test-several-on-page.html
  2. Select text in the first editor and change to Header 1
  3. Do not press inside the text area of the second editor, only select Header 2 from the dropdown
  4. The text from the first editor will change to Header 2

Expected behavior
The text in the header of the first widget should have Header 1

Additional context
Video
Code for reproduction

@tmcconechy tmcconechy added [2] Velocity rating (Fibonacci) type: bug 🐛 team: homepages Issues for the homepages team labels Feb 8, 2022
@tmcconechy tmcconechy added this to Triage in Enterprise (Next) Sprint Grooming via automation Feb 8, 2022
@tmcconechy tmcconechy added this to To do in Enterprise 4.62.x (Mar 2022) Sprint via automation Feb 23, 2022
@tmcconechy
Copy link
Member

I cant seem to reproduce this on this example https://main-enterprise.demo.design.infor.com/components/editor/test-several-on-page.html but lets check that its not an angular only issue. Or maybe each editor needs an ID.

@xqses
Copy link
Author

xqses commented Feb 24, 2022

Interesting, I can reproduce in that example. But it seems like the toolbar has an ID so it makes sense if the editor itself has an ID. https://imgur.com/a/ulyIiDA
However, this bug occurs when we change the header format without clicking inside the text area of the second editor. So to reproduce in that example:

  1. Select text in the first editor and change to Header 1
  2. Do not press inside the text area of the second editor, only select Header 2 from the dropdown
  3. The text from the first editor will change to Header 2

I am not sure exactly how to setup the enterprise repo as an environment where I could play around myself, but glancing at the the editor.js source code I think maybe we can't rely on which editor element is currently selected. Since in this case I assume that the selected element would be editor 1 (where we clicked in the textarea and edited text) rather than element 2 (where we didn't click in the textarea but only used the toolbar)

I might be wrong about that though, but hopefully the repro instructions help.

@tmcconechy
Copy link
Member

Yep that helps - its working on the selected text... But not checking its within the same editor. But FYI if you want to set up the demo repo..

cd some-folder
git clone git@github.com:infor-design/enterprise.git .
// Make sure node 14 is installed (can use https://github.com/coreybutler/nvm-windows)
npm i
npm run start

@jbrcna
Copy link

jbrcna commented Apr 5, 2022

@jbrcna jbrcna moved this from Ready for QA (beta) to Done in Enterprise 4.62.x (Mar 2022) Sprint Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: homepages Issues for the homepages team type: bug 🐛 [2] Velocity rating (Fibonacci)
Projects
No open projects
Development

No branches or pull requests

4 participants