fix(ready): remove class from fragment #1276
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1276
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:featur/fix-remove-class-from-fragment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
<ready>
component is a fragment (has multiple root nodes). Fragments do not support classes set from outside.8a4d104b39
to715120d1be
fix(ready): remove class form fragmentto fix(ready): remove class from fragmentHi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1276-featurfix-remove-class-from-fragment--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
@ -1,5 +1,6 @@
<template>
<ready :class="{'is-touch': isTouch}">
<ready>
<div :class="{'is-touch': isTouch}">
Do we really need that extra div?
It's necessary in the sense that we currently don't have a wrapper div around the app that we could use to add a class (in this case
is-touch
) becauseready
is as said a fragment.But instead of adding a additional div we can also add this class to the body tag. Will do this instead.
715120d1be
to256bf524fe
256bf524fe
tod178bdeb72
d178bdeb72
to5447147c52
5447147c52
toad9bbc71d7
ad9bbc71d7
toc0c0900290
@ -1,16 +1,14 @@
<template>
<ready :class="{'is-touch': isTouch}">
<div :class="{'is-hidden': !online}">
What about this? Is the banner still shown when the user goes offline?
Because of these code lines in the
<ready>
component theis-hidden
class is useless since the slot content would never mount if the user is offline:Ah, makes sense! I guess this is an old one from before the ready component.
@ -0,0 +1,16 @@
import {ref, watchEffect} from 'vue'
import {tryOnBeforeUnmount} from '@vueuse/core'
export function useBodyClass(className: string, defaultValue = false) {
Nice one!
Should be fine once the conflicts are resolved.
c0c0900290
to29d8422e94