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

Table component errors out when prop rows is null #17213

Closed
gauravjhs opened this issue May 20, 2024 · 2 comments
Closed

Table component errors out when prop rows is null #17213

gauravjhs opened this issue May 20, 2024 · 2 comments
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/umd kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@gauravjhs
Copy link

What happened?

Create a table and pass rows props as null.
Component crashes and error log is displayed on console.
Cannot read properties of undefined (reading 'length').
This works if we pass blank array

What did you expect to happen?

Null or Empty Array should behave exactly the same showing a blank table

Reproduction URL

https://codepen.io/gaurav-jhs04/pen/jOoWjbo

How to reproduce?

Go to the above codepen link. See console.

Flavour

UMD

Areas

Components (quasar)

Platforms/Browsers

Firefox, Chrome, Microsoft Edge

Quasar info output

No response

Relevant log output

vue.global.prod.js:7  TypeError: Cannot read properties of undefined (reading 'length')
    at quasar.umd.prod.js:17:203046
    at ue.fn (vue.global.prod.js:7:14050)
    at ue.run (vue.global.prod.js:7:6593)
    at get value (vue.global.prod.js:7:14297)
    at quasar.umd.prod.js:17:203236
    at ue.fn (vue.global.prod.js:7:14050)
    at ue.run (vue.global.prod.js:7:6593)
    at get value (vue.global.prod.js:7:14297)
    at quasar.umd.prod.js:17:197065
    at ue.fn (vue.global.prod.js:7:14050)

Additional context

No response

@gauravjhs gauravjhs added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels May 20, 2024
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/umd labels May 20, 2024
@tegaologe
Copy link

i have the exact problem

@yusufkandemir
Copy link
Member

It's a required/non-nullable prop. So, that is the expected behavior. You should use an empty array. You can do so by doing this :rows="nullableResult ?? []" if you can't handle it anywhere else.

@yusufkandemir yusufkandemir closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/umd kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

3 participants