pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
385 stars 379 forks source link

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

Open stevesuk opened 1 year ago

stevesuk commented 1 year ago

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.

ghost commented 1 year ago

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

github-actions[bot] commented 1 year ago

Thank you for submitting your first issue to this project.

ivonool commented 7 months ago

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

shubhamRathi0608 commented 7 months ago

Any fix yet? Having same issues

shubhamRathi0608 commented 7 months ago

@stevesuk did you find any solution?

stevesuk commented 7 months ago

@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).

shubhamRathi0608 commented 7 months ago

@michaelmaillot any help please?

michaelmaillot commented 7 months ago

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

raclettierer commented 6 months ago

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

magdalenafernlund commented 2 weeks ago

@stevesuk

I had the same issue in a Panel. v3.19.0 When i added eventBubblingEnabled to the Panel component the problem disappeared.

<Panel 
  layerProps={{ eventBubblingEnabled: true }}
  ...otherProps...
</Panel