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

CSS display issues in both Firefox and Chrome with v1.0.5 #181

Closed
1 task done
ofadam opened this issue Jan 19, 2023 · 14 comments · Fixed by #195
Closed
1 task done

CSS display issues in both Firefox and Chrome with v1.0.5 #181

ofadam opened this issue Jan 19, 2023 · 14 comments · Fixed by #195
Assignees
Labels
help wanted Extra attention is needed type:bug Something isn't working.
Milestone

Comments

@ofadam
Copy link

ofadam commented Jan 19, 2023

Describe the bug

After upgrading the "Insert Special Characters" plugin from v1.0.4 to v1.0.5, clicking on the special character icon in the formatting toolbar now shows a horizontal scroll bar in Firefox where one didn't initially appear. Additionally, searching for a character name now gets messy in both Firefox and Chrome.

Steps to Reproduce

  1. Open new story in WordPress
  2. Click on Insert Special Characters plugin icon in toolbar
  3. Search for name of character

Screenshots, screen recording, code snippet

Here's what I see when initially loading the Insert Special Characters plugin using Firefox 108 – a horizontal scroll bar is appearing unnecessarily:
initialview_firefox108_pluginv105

But here's what I see when initially loading the Insert Special Characters plugin using Chrome 108 – no horizontal scroll bar appears, which looks better:
initialview_chrome108_pluginv105

For reference, here's what appeared when loading v1.0.4 of the plugin with Firefox 108 – no horizontal scroll bar as expected:
initialview_firefox108_pluginv104

Searching for a character name in either the latest version of Firefox or Chrome results in this messy view:
search_pluginv105

Environment information

OS: MacOS 12.6.1
Browser: Firefox 108 and Chrome 108

WordPress information

WordPress 6.1.1

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ofadam ofadam added the type:bug Something isn't working. label Jan 19, 2023
@jeffpaul
Copy link
Member

@ofadam is this still occurring for you on v1.0.6?

@jeffpaul jeffpaul added the needs:feedback This requires reporter feedback to better understand the request. label Mar 20, 2023
@jeffpaul jeffpaul self-assigned this Mar 20, 2023
@ofadam
Copy link
Author

ofadam commented Mar 20, 2023

Unfortunately so.
Screen Shot 2023-03-20 at 6 04 25 PM

@github-actions github-actions bot removed the needs:feedback This requires reporter feedback to better understand the request. label Mar 20, 2023
@jeffpaul jeffpaul added the help wanted Extra attention is needed label Mar 23, 2023
@jeffpaul jeffpaul removed their assignment Mar 23, 2023
@jeffpaul jeffpaul added this to the 1.0.7 milestone Mar 23, 2023
@jayedul jayedul self-assigned this May 12, 2023
@jayedul
Copy link
Contributor

jayedul commented May 12, 2023

I couldn't reproduce this issue. Both WordPress and Browsers released updates recently. Maybe fixed meanwhile?

Screenshot 2023-05-13 at 12 29 13 AM Screenshot 2023-05-13 at 12 29 05 AM

@ofadam
Copy link
Author

ofadam commented May 15, 2023

I'm still seeing the original issue on both Firefox 112 and Chrome 113.

@bjorn2404
Copy link
Member

I was able to replicate the horizontal scrollbar appearing in Firefox but not the grid formatting issue. @ofadam What other plugins are installed on the site? Especially interested in tracking down what is adding the blue plus icon in the formatting bar from your screenshot above. Thanks

image

@ofadam
Copy link
Author

ofadam commented May 18, 2023

I have very few plugins installed, but do have one called Multicollab enabled – it creates that blue plus icon in the formatting toolbar.

https://wordpress.org/plugins/commenting-feature/

@bjorn2404
Copy link
Member

@ofadam I'm able to replicate after installing and activating the Multicollab plugin. If I deactivate, the grid formatting problem goes away. Is it possible for you to confirm on your end?

Example with Multicollab activated:

image

Without Multicollab activated:

image

@jeffpaul
Copy link
Member

@poojabhimani12 we're seeing potential compatibility issues between Multicollab and Insert Special Characters... any chance you can share what from Multicollab might be causing this so we can determine how best to ensure both plugins function properly together?

@ofadam
Copy link
Author

ofadam commented May 22, 2023

I've also emailed Multidots (creator of Multicollab) to see if they can assist.

poojabhimani12 added a commit to multidots/multicollab that referenced this issue May 23, 2023
@poojabhimani12
Copy link

@jeffpaul & @ofadam ,

You can find fixes from the above git commit. Please check and let us know.

poojabhimani12 added a commit to multidots/multicollab that referenced this issue May 23, 2023
@ofadam
Copy link
Author

ofadam commented May 23, 2023

@poojabhimani12 That did seem to fix the issue with the grid not displaying correctly – thanks!

@jeffpaul @bjorn2404 I'm still seeing the grid sneaking off screen even when trying to add a special character toward the right of a text block:
Screen Shot 2023-05-23 at 10 09 11 AM

Since the grid doesn't re-flow according to screen size, that makes it more challenging to ensure it properly fits.

@bmarshall511
Copy link
Contributor

Spent quite a bit of time digging into this & have it narrowed down, but haven't found a solution for it yet. You can replicate the issue by using your cursor to select text. If no text is selected, the Popover positions itself correctly. Happens both in Chrome (114.0.5735.90) & FF (114.0)

Looking at anchorRect when working and no text is selected, it provides the correct coordinates:

DOMRect { x: 488.0333251953125, y: 332.1166687011719, width: 0, height: 22, top: 332.1166687011719, right: 488.0333251953125, bottom: 354.1166687011719, left: 488.0333251953125 }

But when text is selected, you always get:

DOMRect { x: 0, y: 0, width: 0, height: 0, top: 0, right: 0, bottom: 0, left: 0 }

causing the positioning to be off.

It seems like the onToggle function that sets the var anchorRange is working as expected, but when the component re-renders to display the Popover, it's set to something different:

onToggle result of anchorRange:

Range { commonAncestorContainer: #text, startContainer: #text, startOffset: 55, endContainer: #text, endOffset: 56, collapsed: false }

After component re-renders anchorRange:

Range { commonAncestorContainer: p#block-29ccd025-90a2-4b92-af05-54610e2bfeeb.block-editor-rich-text__editable.block-editor-block-list__block.wp-block.is-selected.wp-block-paragraph.rich-text, startContainer: p#block-29ccd025-90a2-4b92-af05-54610e2bfeeb.block-editor-rich-text__editable.block-editor-block-list__block.wp-block.is-selected.wp-block-paragraph.rich-text, startOffset: 0, endContainer: p#block-29ccd025-90a2-4b92-af05-54610e2bfeeb.block-editor-rich-text__editable.block-editor-block-list__block.wp-block.is-selected.wp-block-paragraph.rich-text, endOffset: 0, collapsed: true }

Furthermore, looks like the Popover prop getAnchorRect has been deprecated as of 6.1 (https://make.wordpress.org/core/2022/10/10/editor-components-updates-for-wordpress-6-1/) in place of anchor.

Still digging into it ⛏️, but hopefully this helps others replicate & narrow down where to look.

@bjorn2404
Copy link
Member

I was also going to note that you can get rid of the horizontal scrollbar in Firefox by adding a scrollbar-gutter: stable CSS rule to .components-popover__content but that can leave a gap on the right of the popover if there is no vertical scroll (less icons appearing), which might not be ideal.

@bmarshall511
Copy link
Contributor

@ofadam @jeffpaul Think I got it, that was a doozy! You can find the fix in the commit above.

@jeffpaul jeffpaul assigned bmarshall511 and unassigned jayedul Jun 8, 2023
@dkotter dkotter modified the milestones: 1.0.7, 1.1.0 Jun 16, 2023
@dkotter dkotter modified the milestones: 1.1.0, 1.0.7 Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type:bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants