pnp / pnp/sp-dev-fx-controls-react
Rich text control does not allow to type in space character
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ 3.15.0 ]
Expected / Desired Behavior / Question
I can type in space into RichText control.
Observed Behavior
onChange callback does not fire when space key is pressed. Also pasting (CTRL+V) space character does nothing. Only way to add space is pasting text that has some text surrounding spaces.
Steps to Reproduce
SPFx version: 1.17.3
Simple SPFx Webpart. I have a button on property pane, that makes a Fluent UI Panel open. On this panel I have a RichText control. It is controlled with reducer-based state.
<Stack styles={{ root: { paddingTop: 32 } }}>
<RichText value={item.value}
className={"ql-active"}
isEditMode={item.type === ECustomPropertyType.Static}
onChange={(v) => {
console.log("CHANGE", v); // shows that no event is fired for space
actions.changeValue({ id: item.id, value: v }); // action that changes state through reducer
return v;
}} />
</Stack>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the controlled RichText example in an SPFx 1.17.3 web part, checking both typing and pasting a space. Trace the RichText onChange path and state updates; the issue is done when standalone spaces trigger onChange and appear correctly in the control.
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