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

Card: Updates firing too many times when InputText is inside of card #5205

Closed
rozman50 opened this issue Feb 4, 2024 · 1 comment
Closed
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@rozman50
Copy link

rozman50 commented Feb 4, 2024

Describe the bug

I have a website, which contains table with around 1000 rows and around 15 columns. I also put InputText on top of table, to enable search. The problem is, that for every character inputed in search field, function for determining class is called for every cell. This means for every character inputed, testFunc is called 15 000 times.
Problem is solved if I put InputText outside of Card.

On Stackblits, I had to increase number of rows to 1000, to see bad performance. On my local machine, 500 was enough.

Not working:

explorer_aRudMxqX8z.mp4

Working:

firefox_YVVvNkGRIq.mp4

Reproducer

https://stackblitz.com/~/edit/primevue-create-vue-issue-template-p6xwch?view=editor

PrimeVue version

3.47.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Firefox 122.0 (64-bit), Google Chrome 121.0.6167.140 (Official Build) (64-bit)

Steps to reproduce the behavior

  1. Create new page.
  2. Paste code from stackblitz
  3. Uncomment L17 - L22 and start typing in InputText. Console will show a lot of "testFunc" logs
  4. Comment L17-L22 back and uncomment L3-L12 and start typing in InputText. You should see increased performance and no "testFunc" logs (just those from when table renders)

Expected behavior

Typing in InputText should not trigger updates of all elements inside of Card.

@rozman50 rozman50 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 4, 2024
@mertsincan
Copy link
Member

Hi,

This is not related to PrimeVue. I tried it with HTML input after removing all PrimeVue components. I get the same results. https://stackblitz.com/~/edit/primevue-create-vue-issue-template-rlsznw

If you want to use PrimeVue datatable for this, you can use lazy / virtualscroller modes to get more performance. Please see my post; https://dev.to/mertsincan/handling-big-data-on-datatable-with-checkbox-selection-multiselect-4hgc

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants