sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

RichText - toolbar persists when control loses focus, when rendered inside Panel or Modal

Open stevesuk opened this issue 2 years ago • 10 comments

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version 3.15.0

Expected / Desired Behavior / Question When I place a RichText control inside a Modal or Panel, I would expect that when the control loses focus, the toolbar should automatically hide.

Observed Behavior The RichText toolbar is on screen permanently, no matter which element on the page has focus.

Steps to Reproduce Use YO to setup a new Web Part project, add @pnp/spfx-controls-react to the project. Modify default React class component to add something like this to the render function:

<Panel isOpen={true} type={PanelType.medium} >
  <TextField value={this.state.textField} onChange={(event, value) => { this.setState({textField: value}); }} />
  <RichText value={this.state.richTextField} onChange={(text) => { this.setState({richTextField: text}); return(text); }} />
</Panel>

Observe that when clicking inside the RichText control, then clicking in the plain text field above it - the RichText toolbar remains visible.

image

Sit the same two text edit controls outside of the Panel (i.e. in the main body of the web part), and observe that focus/blur works fine.

stevesuk avatar Aug 10 '23 08:08 stevesuk

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

ghost avatar Aug 10 '23 08:08 ghost

Thank you for submitting your first issue to this project.

github-actions[bot] avatar Aug 10 '23 08:08 github-actions[bot]

I have the same issue with this control on a panel - v3.17.0

ivonool avatar Mar 27 '24 12:03 ivonool

Any fix yet? Having same issues

shubhamRathi0608 avatar Apr 08 '24 08:04 shubhamRathi0608

@stevesuk did you find any solution?

shubhamRathi0608 avatar Apr 08 '24 08:04 shubhamRathi0608

@stevesuk did you find any solution?

Wasn't able to find a fix for the reported bug. In the end we changed our solution to use the TinyMCE richtext editor instead (which was a minor battle in itself - but we got there).

stevesuk avatar Apr 08 '24 09:04 stevesuk

@michaelmaillot any help please?

shubhamRathi0608 avatar Apr 08 '24 09:04 shubhamRathi0608

Hi @shubhamRathi0608, I'll try to have a look at some point, but feel free to give a try 🙂

michaelmaillot avatar Apr 08 '24 20:04 michaelmaillot

I have the same problem. in addition when I close the panel and reopen the extenden Dialog won't open any more

raclettierer avatar May 07 '24 11:05 raclettierer