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

Invalid type error for tags #3887

Closed
kakulukia opened this issue Sep 19, 2023 · 5 comments
Closed

Invalid type error for tags #3887

kakulukia opened this issue Sep 19, 2023 · 5 comments
Assignees
Labels

Comments

@kakulukia
Copy link

Overview of the problem

Buefy version: 0.9.23
Vuejs version: 2.6.14
OS/Browser: OSX / Chrome

Description

I wanted to try different tag types based on conditions. In this case i have a time table with bookable slots, reserved one and one selected item.

I used the following code to get this result:
b-tag(:type="{ 'is-primary': !isBooked(day, slot), 'is-light': !isSelected(slot, day) }") [[ slot.start]] - [[ slot.end ]]

SCR-20230919-aej

But, even tho we see it working it is producing the following error:

SCR-20230919-ajl

Steps to reproduce

  1. User a tag item with an object for its type rather than strings

Expected behavior

As objects already work, the above error should not be triggered.

Actual behavior

I see errors popping up AND Buefy accepting the object and rendering the type correctly.

I tried to set this CodePen template up, but it wasnt displaying Buefy CSS for me.
Anyway, this works for me as some test code:

<b-field><b-tag :type="{'is-primary': true}">test</b-tag><b-field>

And interestingly it is producing two error for this one tag item.

@wesdevpro wesdevpro self-assigned this Sep 19, 2023
@wesdevpro wesdevpro added the bug label Sep 19, 2023
@wesdevpro
Copy link
Member

@kakulukia can you please share a code pen. Thanks

@kakulukia
Copy link
Author

Hi @wesdevpro ,

i had a second try to create a codepen, but have a look: its not executing as it should.
SCR-20231012-i1p

Could you please provide a working empty template?
Here is the test code anyway: https://codepen.io/kakulukia/pen/vYvPwBN

@wesdevpro
Copy link
Member

wesdevpro commented Oct 12, 2023

Hi @wesdevpro ,

i had a second try to create a codepen, but have a look: its not executing as it should. SCR-20231012-i1p

Could you please provide a working empty template? Here is the test code anyway: https://codepen.io/kakulukia/pen/vYvPwBN

Sure! It depends on what framework you are using. @kakulukia are you just using Buefy and vue2?
Interesting.

@kakulukia
Copy link
Author

yes, buefy and vue2

@kikuomax kikuomax self-assigned this Dec 5, 2023
@kikuomax
Copy link
Collaborator

kikuomax commented Dec 5, 2023

@kakulukia You are right. type is passed to class attribute of <span>s in BTag:

:class="[type, size, { 'is-rounded': rounded }]">

:class="[type, size, { 'is-rounded': rounded }]">

It may be any object that class can accept. So I think we can safely declare type may be String or Object.

kikuomax added a commit to kikuomax/buefy that referenced this issue Dec 5, 2023
- Fixes the issue that `Tag` did not accept objects as its `type`
  while objects actually work. Adds `Object` to acceptable types of
  `type`.

issue buefy#3887
kikuomax added a commit that referenced this issue Dec 6, 2023
- Fixes the issue that `Tag` did not accept objects as its `type`
  while objects actually work. Adds `Object` to acceptable types of
  `type`.

issue #3887
@kikuomax kikuomax closed this as completed Dec 6, 2023
kikuomax added a commit to kikuomax/buefy that referenced this issue Jan 10, 2024
- Fixes the issue that `Tag` did not accept objects as its `type`
  while objects actually work. Adds `Object` to acceptable types of
  `type`.

issue buefy#3887
kikuomax added a commit to kikuomax/buefy that referenced this issue Feb 11, 2024
- Fixes the issue that `Tag` did not accept objects as its `type`
  while objects actually work. Adds `Object` to acceptable types of
  `type`.

issue buefy#3887
kikuomax added a commit to ntohq/buefy-next that referenced this issue Feb 12, 2024
- Fixes the issue that `Tag` did not accept objects as its `type`
  while objects actually work. Adds `Object` to acceptable types of
  `type`.

issue buefy#3887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed ✅
Development

No branches or pull requests

3 participants