thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

Speech bubble styles applied to wrong pieces of text #1291

Open FayCross opened 1 week ago

FayCross commented 1 week ago

Reported by Lilian on the forums.

See here recording of the bug here: https://york.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=2212fd24-b513-43f2-8144-b1930092e342

When applying a speech bubble style to a piece of text in a text field, if there are other text fields shown in the editor, the style is applied to text in the final text field and not the one you are editing. Any other styles (panels, highlights etc.) are applied correctly

FayCross commented 1 week ago

This is a really odd one. @ronm123 - I think it was you who first added the speech bubble styles, any ideas where to start with working out what's going on? I'm assuming this bug must be new as I imagine it would have come up before if not.

ronm123 commented 1 week ago

@FayCross yes this is very odd indeed! I was offline earlier when I saw your message so couldn't test but I've been testing now and went through a few things... At first I wondered if it was specific to the newer page/project intro functionality because that obviously didn't exist in some earlier versions but it's not that. We obviously don't have too many page types that display multiple text editor boxes at the same but we've had orientation and summary page types for years and it happens on them too! So using the orientation page as a test case I tested with 3.9, 3.10 and 3.12 and the same thing happens with all of them! I could understand if it happened in 3.12 but not say 3.9 or 3.10 but it happens in all of those versions and that just raises the question how has this not cropped up before? I did initially add the speech bubble styles but I think it was @JohnSmith-LT who got that working in CKE. The styles still work correctly if added via source view e.g. <div class="speech-bubble1 style-wrap"> <p>speech text here</p></div> so I'm guessing it's the script involved in identifying what is selected that is going wrong now and I wonder if that is perhaps written in a way that worked fine previously but has been impacted by browser compatibility or something like that otherwise how have we not noticed it before. Possibly style-wrap or the script that adds that? I'll reply to the forum thread with a suggested workaround for now.

FayCross commented 1 week ago

Yes, I tested with orientation page too. I think there's a chance it's always been there and we just haven't had it reported to us or tried it ourselves. We probably should upgrade to CKEditor 5...