Skip to content

refactor: Use boolean props with default value false#6452

Merged
susnux merged 1 commit into
masterfrom
refactor/boolean-props-1
Feb 12, 2025
Merged

refactor: Use boolean props with default value false#6452
susnux merged 1 commit into
masterfrom
refactor/boolean-props-1

Conversation

@susnux

@susnux susnux commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

☑️ Resolves

Provide disableSwipe instead of allowSwipeNavigation (NcAppContent) and enableSwipe (NcModal).

Boolean prop should always - when possible - have a default value of false to allow shorthand prop assignment in the template. Similar to native HTML boolean attributes:

<!-- native HTML -->
<button disabled>
<!-- boolean Vue prop with default false -->
<NcModal disable-swipe>

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

@susnux susnux added 3. to review Waiting for reviews refactor ♻️ Pull request that is neither a fix nor a feature labels Jan 23, 2025
@susnux susnux added this to the 8.23.0 milestone Jan 23, 2025
@susnux

susnux commented Jan 23, 2025

Copy link
Copy Markdown
Contributor Author

/backport to next

Provide `disableSwipe` instead of `allowSwipeNavigation`
(`NcAppContent`) and `enableSwipe` (`NcModal`).

Boolean prop should always - when possible - have a default value of
`false` to allow shorthand prop assignment in the template.
Similar to native HTML boolean attributes:

```vue
<!-- native HTML -->
<button disabled>
<!-- boolean Vue prop with default false -->
<NcModal disable-swipe>
```

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the refactor/boolean-props-1 branch from 852c87e to b76ed2a Compare January 23, 2025 22:19

/**
* Enable swipe between slides
* @deprecated Will be removed in next version - use `disableSwipe` instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking, but don't forget to replace it for next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature or request refactor ♻️ Pull request that is neither a fix nor a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants