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

Rich text control does not allow to type in space character

Open
#1,665 5 comments 0 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

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.