p-editor automatically gains focus when intializing model with data #9664
Labels
LTS-FIXED-9.2.2
Fixed in PrimeNG LTS 9.2.2
LTS-FIXED-10.0.7
Fixed in PrimeNG LTS 10.0.7
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
If you have a PrimeNG PRO Support subscription please post your issue at;
https://pro.primefaces.org
where our team will respond within 4 business hours.
If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that
your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.
Current Queue Time for Review
Without PRO Support: ~8-12 weeks.
With PRO Support: 1 hour
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.
https://stackblitz.com/github/primefaces/primeng-issue-template
Current behavior
When I have a component with various form controls and a p-editor, if I load data in my editor's ngModel when initializing the component, the editor automatically gains focus.
This doesn't happen when the model is initialized with an empty string.
This issue has been reported before, here: #5244
It was closed, but we still experience this problem, and judging by this quill issue it might not only be related to quill but also to how PrimeNG implements quill.
Expected behavior
Editor shouldn't autofocus, especially since it is not the first control on the page.
Minimal reproduction of the problem with instructions
Codewise, here is a basic example of how we use the editor.
(This stackblitz is to demonstrate how we use the editor, but is not an actual reproduction of the problem, since in the template that you provided the prime editor seems to crash).
What is the motivation / use case for changing the behavior?
In our case we trigger functionality on focus of the p-editor, and we only want to do this when the user focuses on purpose. Also, we don't want the page to automatically scroll down to the p-editor when the user enters the page.
Also, from an accessibility perspective this is an issue.
Please tell us about your environment:
OS: MacOs Big Sur 11.0.1
Angular version: 9.0.6
PrimeNG version: 10.0.3
Browser: Chrome, latest version
Language: TypeScript 3.7.5
Node (for AoT issues): 12.16.1
The text was updated successfully, but these errors were encountered: