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

No Ripple effect in Vuetify 1.3.0 using Electron (vue-cli-plugin-vuetify) #5340

Closed
4eveRS opened this issue Oct 18, 2018 · 10 comments
Closed
Assignees
Labels
T: bug Functionality that does not work as intended/expected
Milestone

Comments

@4eveRS
Copy link

4eveRS commented Oct 18, 2018

Versions and Environment

Vuetify: 1.3.0
Vue: 2.5.17
Browsers: Electron 2.0.11
OS: Mojave 10.12

Previously worked in:

Vuetify: 1.2.10
Vue: 2.5.17

Steps to reproduce

Create a project following the guidelines:

vue create my-app
vue add electron-builder
vue add vuetify
npm run serve:electron

Expected Behavior

Buttons should have ripple effect

Actual Behavior

No ripple effect is present, even when I tried to set it using tje component property ripple.


Additional Comments:

I think maybe this is caused by the new tree shake?
I test with other versions 1.2.9, 1.2.8, 1.2.7 and all worked perfectly.

@4eveRS 4eveRS changed the title No Ripple effect in Vuetify 1.3.0 in Electron (Using vue-cli-plugin-vuetify) No Ripple effect in Vuetify 1.3.0 using Electron (Using vue-cli-plugin-vuetify) Oct 18, 2018
@4eveRS 4eveRS changed the title No Ripple effect in Vuetify 1.3.0 using Electron (Using vue-cli-plugin-vuetify) No Ripple effect in Vuetify 1.3.0 using Electron (vue-cli-plugin-vuetify) Oct 18, 2018
@KaelWD
Copy link
Member

KaelWD commented Oct 18, 2018

What options did you select when creating the project and initialising the plugins?

@4eveRS
Copy link
Author

4eveRS commented Oct 18, 2018

Vue CLI preset: Default
Pre-made template: yes
Custom theme: no
Custom properties: no
Icon font: material icons
Font as dependency: yes
A-la-carte components: no
Babel/polyfill: yes
Locale: english

@taai
Copy link
Contributor

taai commented Oct 18, 2018

It is a bug. I'm pretty sure that the cause of that is undefined variable $ripple-animation-transition used here:
https://github.com/vuetifyjs/vuetify/blob/v1.3.0/src/stylus/components/_sliders.styl#L198

It stays like that in result CSS too:

transition: $ripple-animation-transition;

In version 1.2.10 there was a variable $ripple-animation-transition, but in version 1.3.0 it is not defined anymore, there are variables $ripple-animation-transition-in and $ripple-animation-transition-out defined instead.
You can compare:
https://github.com/vuetifyjs/vuetify/blob/v1.2.10/src/stylus/settings/_variables.styl#L303
https://github.com/vuetifyjs/vuetify/blob/v1.3.0/src/stylus/settings/_variables.styl#L316-L317

Blame @nekosaur and @johnleider 😉

@KaelWD
Copy link
Member

KaelWD commented Oct 18, 2018

Looks like that variable was removed by #5059, but is a separate issue. I'll spin up a CLI project soon and have a look.

@KaelWD KaelWD added pending review The issue is still pending disposition S: needs reproduction The issue does not contain a valid reproduction and removed S: need more info pending review The issue is still pending disposition labels Oct 18, 2018
@KaelWD
Copy link
Member

KaelWD commented Oct 20, 2018

I can't reproduce this issue.

@taai
Copy link
Contributor

taai commented Oct 20, 2018

@KaelWD Download and open the compiled ZIP file of the version 1.3.0 ( https://github.com/vuetifyjs/vuetify/releases/tag/v1.3.0 ), open the vuetify-v1.3.0.css file and in the line 8610 you will see this line:

  transition: $ripple-animation-transition;

– this is how you reproduce this issue. 🙃

For me this issue exists in SASS when trying to include that CSS file – SASS starts complaining about that [used but undefined] variable. CSS is free, in CSS files there should be no dollar signs. 😉

@KaelWD
Copy link
Member

KaelWD commented Oct 20, 2018

I agree that line shouldn't be there, but it has nothing to do with buttons. I followed the instructions you provided and could not find the problem you described. Does the issue only occur because SASS can't find the variable, do ripples work correctly if you load the vuetify CSS normally instead of through SASS?

@taai
Copy link
Contributor

taai commented Oct 20, 2018

@KaelWD Who cares about ripples if they can't compile SASS at all (it throws errors)?! 😉 Forget about SASS or Electron, check the CSS specification and you will not find $ripple-animation-transition as a value of CSS property transition. CSS preprocessors replaces variables with defined values. Apparently CSS preprocessor Stylus doesn't throw errors about used but undefined variables and it has left the $ripple-animation-transition as a legit CSS value (which it is not).```

The browser doesn't care, it will ignore invalid CSS properties and/or values, so probably you will not notice the problem in your browser right away. I don't know what exactly uses the CSS class .v-slider__thumb-container:before , I only know that it uses that variable and that causes me problems. Version 1.3.0 and that in this issue there is something to do with a ripple effect and the variable contains the name "ripple"... I did my quick research thru the git history and I'm pretty sure this is the problem.

I don't use Stylus, so I can only guess how that variable got into resulting compiled CSS file (SASS, for example, throws errors in such cases)... But this is definitely a bug.

I got rid of this bug by compiling the CSS myself until this issue gets fixed:

$ripple-animation-transition := 0.4s cubic-bezier(0, 0, 0.2, 1)
@import '~vuetify/src/stylus/main'

@johnleider johnleider added T: bug Functionality that does not work as intended/expected and removed S: needs reproduction The issue does not contain a valid reproduction labels Oct 20, 2018
@johnleider johnleider self-assigned this Oct 20, 2018
@johnleider johnleider added this to the v1.3.x milestone Oct 20, 2018
@4eveRS
Copy link
Author

4eveRS commented Oct 21, 2018

@johnleider @KaelWD The bug still persists, but I found the solution to it.

When creating the new animation/transition of the ripple effect, there's a lot of divisions that can lead to decimal values.

These calculations were introduced when the new ripple effect code was implemented.

Link to the updated ripple effect files

Using electron at version @2.0.X or @3.0.x, or even utilising an older version of chrome, makes all the divisions lead to a decimal value using "," instead of ".", knowing that, there's is a issue in older versions of chrome, that makes it only reproduce animations/transitions with a decimal value using a "." and not a ",".

Example:
transition: width 0.3s; (works).
transition: width 0,3s; (fails)

It's a know bug at chrome and was only fixed in chrome v68.0.3409.0 which is not currently supported by any stable version of Electron.

Link to the explanation of the bug in vue/chrome/electron

So when dividing a to calculate the radius and all for the new ripple effect, it can lead to numbers with decimals, which lead to the know bug. That's why I was having intermittent ripple effects. Sometimes the calculation works perfectly and sometimes it makes a decimal and doesn't work at all.

So the fix is easy as it only requires a: .replace(',', '.')) in the variables that control the duration on the transition.

@KaelWD
Copy link
Member

KaelWD commented Oct 21, 2018

That explains why I couldn't reproduce it, decimals are . in my locale.

@KaelWD KaelWD reopened this Oct 21, 2018
@KaelWD KaelWD self-assigned this Nov 22, 2018
@KaelWD KaelWD closed this as completed in 1058210 Nov 22, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Nov 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

4 participants