vuetify-dialog icon indicating copy to clipboard operation
vuetify-dialog copied to clipboard

Reset of vuetify's RTL

Open PowerSlime opened this issue 5 years ago • 5 comments

Problem

After invoking any of $dialog method (notify, confirm), RTL that was set dynamically resets to it's default value.

Steps to reproduce

  1. Set vuetify's rtl option as true
  2. In mounted of any component set this.$vuetify.rtl to false
  3. Open dialog/notification
  4. RTL was reseted to true

Sandbox example

https://codesandbox.io/s/nuxtjs-vuetify-qbcrl

PowerSlime avatar Oct 21 '19 14:10 PowerSlime

If somebody have problems as I, temporary it can be fixed by this "hack" in default or any other of your templates:

  data: {
    rtl: this.$vuetify.rtl
  },

  watch: {
    rtl(bool) {
      this.$vuetify.rtl = bool;
    },

    "$vuetify.rtl"() {
      this.$vuetify.rtl = this.rtl;
    }
  }

PowerSlime avatar Oct 22 '19 12:10 PowerSlime

Hi, @PowerSlime! It's very wierd behavior. VuetifyDialog doesn't impact on any $vuetify params, and doesn't reassign rtl. We need to investigate this with some debugging or test Your proposition is not solve problem, because you will need this hack in every component, where you will use dialog

yariksav avatar Oct 22 '19 12:10 yariksav

Hi, @PowerSlime! It's very wierd behavior. VuetifyDialog doesn't impact on any $vuetify params, and doesn't reassign rtl. We need to investigate this with some debugging or test Your proposition is not solve problem, because you will need this hack in every component, where you will use dialog

Yes, you're right. I think, one thing that can do this "side-effect" is vuetify/lib's import. So... Maybe problem can be from vuetify too, Need to be tested, but for I've no idea how to reproduce this one without your lib

PowerSlime avatar Oct 22 '19 13:10 PowerSlime

One of temporary stub to resolve this:

this.$vuetify.rtl = true
this.$dialog.context.vuetify.preset.rtl = true

i.e we need to set rtl of vuetify preset options Later I will think how to fix this

yariksav avatar Oct 22 '19 14:10 yariksav

Oh! Great! Maybe we can something like "manual setting" of RTL mode to your lib, if any of more "better" solutions will not be found :D

Anyway, thank you for helping, and for awesome lib for dealing with dialogs :)

PowerSlime avatar Oct 22 '19 18:10 PowerSlime