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: allow false type in BaseClassList #4112

Merged
merged 1 commit into from
May 8, 2023

Conversation

steve8708
Copy link
Contributor

@steve8708 steve8708 commented May 8, 2023

Overview

this allows for doing things like this

<div
  class={[
    !show.value && 'hidden',
    'text-white ...'
  ]}>

I quite like this format compared to objects, and right now I instead have to do this due to false not being allowed

<div 
  class={[
    !show.value ? 'hidden' : null,
    'text-white ...'
  ]}>

From what I can tell serializeClass already supports this, we just need the typings to reflect that

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

this allows for doing things like this

```
class={[
  !show.value && 'hidden',
  'text-white ...'
  ]}
  ```

  I quite like this format compared to objects, and right now I instead have to do this due to `false` not being allowed

  ```
  class={[
    !show.value ? 'hidden' : null,
    'text-white ...'
    ]}
    ```
@stackblitz
Copy link

stackblitz bot commented May 8, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@steve8708 steve8708 changed the title core: allow false in BaseClassList fix: allow false in BaseClassList May 8, 2023
@steve8708 steve8708 changed the title fix: allow false in BaseClassList fix: allow false type in BaseClassList May 8, 2023
@manucorporat manucorporat merged commit 7085871 into QwikDev:main May 8, 2023
19 checks passed
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.

None yet

2 participants