Skip to content

Editor: get focus immediately after first render + get focus after every change of its value #6936

@avasuro

Description

@avasuro

Describe the bug

Editor component become focused:

  1. After first render if editor has some initial value
  2. After every change of value property

Reproducer

https://codesandbox.io/p/sandbox/primereact-listbox-crash-forked-tpgv44

System Information

System:
OS: Windows 11 10.0.22621
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1235U
Memory: 1.19 GB / 15.71 GB
Binaries:
Node: 18.20.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (126.0.2592.113)
Internet Explorer: 11.0.22621.3527
npmPackages:
primereact: 10.7.0 => 10.7.0
react: 18.3.1 => 18.3.1

Steps to reproduce the behavior

In the demo llink above:

  1. Immediately after first render button "Set random quill value" should be focused - pay attention that it is not
    1.1 NOTE: if you remove initial value of quill editor - then button will have initial focus as expected.
  2. Click on "Set random quill value" button - pay attention that after that focus goes into editor, while it is expected that focus should stay on the clicked button.

Expected behavior

If value of the quill editor changes focus should stay where it was before

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a defect related to a specific component.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions