pnp / pnp/sp-dev-fx-controls-react

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

Open
#1,619 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted type:bug
Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with RichText and TextField inside an open Panel or Modal, then inspect the RichText focus and blur handling. Confirm the toolbar hides when focus moves to the TextField or another element, while retaining the existing behavior outside the Panel; add or update coverage if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.