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

p-editor automatically gains focus when intializing model with data #9664

Closed
Erlemorgaine opened this issue Dec 16, 2020 · 0 comments
Closed
Assignees
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

Comments

@Erlemorgaine
Copy link

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")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Dec 16, 2020
@yigitfindikli yigitfindikli added this to the 11.1.0 milestone Dec 29, 2020
@yigitfindikli yigitfindikli self-assigned this Dec 29, 2020
@yigitfindikli yigitfindikli added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Dec 29, 2020
yigitfindikli added a commit that referenced this issue Dec 29, 2020
Fixed #9664 - fix so that editor doesnt automatically autofocus
@yigitfindikli yigitfindikli added LTS-FIXED-10.0.7 Fixed in PrimeNG LTS 10.0.7 LTS-FIXED-9.2.2 Fixed in PrimeNG LTS 9.2.2 and removed LTS-PORTABLE labels Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants