Skip to content
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

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

Closed
avasuro opened this issue Jul 27, 2024 · 1 comment · Fixed by #6937, leoo1992/GeradorQRCode#80 or leoo1992/GeradorQRCode#85 · May be fixed by mtech-31-quemistry/quemistry_client_web#20
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@avasuro
Copy link
Contributor

avasuro commented Jul 27, 2024

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

@avasuro avasuro added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 27, 2024
@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jul 27, 2024
@melloware melloware added this to the 10.7.1 milestone Jul 27, 2024
@melloware
Copy link
Member

Nice debugging and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment