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

RichText state bug when clicking "outside" of component #428

Closed
SharePickle opened this issue Dec 6, 2019 · 6 comments
Closed

RichText state bug when clicking "outside" of component #428

SharePickle opened this issue Dec 6, 2019 · 6 comments

Comments

@SharePickle
Copy link
Contributor

SharePickle commented Dec 6, 2019

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version

1.15.0

Description

Incorrect state.editing value is set when clicking on any layered components (Fabric UI layer) inside editor panel, for example, color picker or fonts dropdown.
This happens because elementContains returns false for Dropdown options, despite them being "inside" panel.

image

 _this.handleClickOutside = function (event) {
            // THIS LINE has the bug
            // Fabric Layer component is outside of the panel and host component
            var outside = !Utilities_1.elementContains(_this._wrapperRef, event.target);
            // Did we click outside?
            if (outside) {
                // If we are currently editing, stop editing
                // -- unless we're using the property pane or the dialog
                if (_this.state.editing) {
                    _this.setState({
                        editing: false
                    });
                }
            }
            else {
                // We clicked inside
                if (!_this.state.editing) {
                    // if we aren't currently editing, start editing
                    _this.setState({ editing: true });
                }
            }
        };

Expected / Desired Behavior / Question

When clicking inside editor panel state should not change to editing = false.

Observed Behavior

When clicking inside editor panel state changes to editing = false thus breaking component state.

Steps to Reproduce

Click ... (more) on the quill editor bar, select any color or font size.

EDIT: hm, it's not a Layer issue, but the fact that when clicking on dropdown option it's being removed before elementContains has a chance to check if it's inside.

@ghost
Copy link

ghost commented Dec 6, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Dec 6, 2019
@michaelmaillot
Copy link
Collaborator

hi @SharePickle,

Did you have the chance to test this on latest version (3.15.0)? I tried it on my side and it works.

@SharePickle
Copy link
Contributor Author

@michaelmaillot hey, we decided to not use this component, so I can't tell if it works, sorry.
I'm going to close this I think, as it's no longer relevant.

@stevesuk
Copy link

stevesuk commented Aug 9, 2023

I have a similar issue. If you place the RichText control inside a Fluent UI React Panel or Modal - the rich text editor toolbar seems to not disappear when the the editor loses focus. This is quite annoying if you have a series of fields on a form, because the toolbar tends to cover over the field above, making it unusable. Anyone have a workaround?

@michaelmaillot
Copy link
Collaborator

michaelmaillot commented Aug 10, 2023

Hi @stevesuk,

I confirm I can repro what you've experienced, with both Dialog & Panel.

Would you mind declaring an issue with all the requested info, including screenshots?

@stevesuk
Copy link

Would you mind declaring an issue with all the requested info, including screenshots?

Hello - yes, will certainly do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants