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

fix(SelectMenu): multiple count error on page load #2216

Closed
wants to merge 1 commit into from

Conversation

NasrALdaya
Copy link

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac
Copy link
Member

benjamincanac commented Sep 20, 2024

I don't think this fix is correct, my guess is the selected computed introduced in #1349 is not taking the by key into account.

@cernymatej
Copy link
Member

@benjamincanac While this does fix the problem in the linked issue, it doesn't resolve the underlying problem, which is that the selected computed property doesn't take the by prop into account.
I would approach it like this: #2228

@NasrALdaya
Copy link
Author

@benjamincanac When the page loads and there are selected values, the selected computed property doesn't correctly reflect those values, leading to an incorrect length.
However, I noticed that props.modelValue.length always returns the correct length of the selected items.

@NasrALdaya
Copy link
Author

NasrALdaya commented Sep 21, 2024

@benjamincanac The filter condition isn't working on page load, and the selected computed property is empty.

Screenshot 2024-09-21 084935

The result:

const options = [
  { key: 'id', label: 'ID' },
  { key: 'title', label: 'Title' },
  { key: 'status', label: 'Status' }
]

const selected = ref([
  { key: 'id', label: 'ID' },
  { key: 'title', label: 'Title' }
])

Screenshot 2024-09-21 084713

@cernymatej
Copy link
Member

@NasrALdaya I've already fixed it in my PR

@NasrALdaya NasrALdaya closed this Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants