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

[Bug][Fix]: ChartLegend trying to add space character to class list #1019

Open
weristwiegott opened this issue Jan 26, 2025 · 0 comments
Open

Comments

@weristwiegott
Copy link

Image

How does the new code fix the error?

It prevents blank space from being added to classList.

Old code

onMounted(() => { const selector = `.${BulletLegend.selectors.item}` nextTick(() => { const elements = elRef.value?.querySelectorAll(selector) const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split('') elements?.forEach((el) => el.classList.add(...classes, '!inline-flex', '!mr-2')) }) })

New code

onMounted(() => { const selector = `.${BulletLegend.selectors.item}` nextTick(() => { const elements = elRef.value?.querySelectorAll(selector) const classes = buttonVariants({ variant: 'ghost', size: 'xs' }).split('') elements?.forEach((el) => { el.classList.add(...classes.filter((classValue) => classValue != ' '), '!inline-flex', '!mr-2') }) }) })

File:

ui/chart/ChartLegend.vue

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

No branches or pull requests

1 participant