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

refactor: Use boolean props with default value false #6452

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 23, 2025

☑️ 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
Copy link
Contributor Author

susnux commented Jan 23, 2025

/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
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

@susnux susnux merged commit 906fafe into master Feb 12, 2025
23 checks passed
@susnux susnux deleted the refactor/boolean-props-1 branch February 12, 2025 15:38
@Antreesy Antreesy added the enhancement New feature or request label Feb 13, 2025
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