-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rich text control does not allow to type in space character #1665
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Thank you for submitting your first issue to this project. |
Hey @majkelmichel Below is my sample, which works fine. <RichText
label="My rich text field"
value={this.state.richTextValue}
isEditMode={this.props.displayMode === DisplayMode.Edit}
onChange={this._getRichTextValue} />
<PrimaryButton text='Reset text' onClick={() => { this.setState({ richTextValue: 'test' }); }} /> and private _getRichTextValue(v: string) {
console.log('value:', v);
this.setState({ richTextValue: v });
return v;
} and below are the logs from console. Will you be able to try this approach and let me know if this is working for you. Thanks, |
Hi @NishkalankBezawada import * as React from 'react';
import { useState } from 'react';
import { RichText } from "@pnp/spfx-controls-react/lib/controls/richText";
import { DetailsList, IColumn, SelectionMode } from "office-ui-fabric-react";
export default function RichTextBug(): JSX.Element {
const [value, setValue] = useState("");
const columns: IColumn[] = [
{
key: "richtext",
name: "Rich Text",
fieldName: "rich-text",
minWidth: 200,
onRender: () => (
<RichText value={value} isEditMode={true} onChange={(v) => {
console.log("VALUE", v); // ! space is not registered because DetailsList stop propagation of keydown event
setValue(v);
return v;
}}
/>
)
}
];
return (
<DetailsList items={[1]} columns={columns} selectionMode={SelectionMode.none} />
);
}
|
Hello majkelmichel or anyone else reading.
|
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 aRichText
control. It is controlled with reducer-based state.The text was updated successfully, but these errors were encountered: