yariksav / vuetify-dialog

Easy dialogs in Vuetify.js framework
MIT License
195 stars 48 forks source link

Reset of vuetify's RTL #52

Open PowerSlime opened 4 years ago

PowerSlime commented 4 years ago

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 commented 4 years ago

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;
    }
  }
yariksav commented 4 years ago

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

PowerSlime commented 4 years ago

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

yariksav commented 4 years ago

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

PowerSlime commented 4 years ago

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 :)