matthias-vogt / legitRipple.js

Material Design ripples with jQuery

Home Page:https://matthias-vogt.github.io/legitRipple.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

maxDiameter default doesn't adapt on element aspect ratio change

matthias-vogt opened this issue · comments

Since maxDiameter is set depending on the parent's aspect ratio, if the aspect ratio changes while the ripple is still visible, the ripple won't cover the whole element anymore.

This can't be fixed 100% in all cases since element size changes don't trigger an event, the most common way this problem would occur, however, is probably when the window resizes.
So one could add a resize handler to the window and update maxDiameter on resize but that would also require throttling to not make resizing choppy and would blow up the code too much and be a bit overkill.

Possible approach: Add $.ripple.updateDiameter() method that the user can call when needed