From f81cec2cbeb5621ff99da07ac87594d93cb1e064 Mon Sep 17 00:00:00 2001 From: Enlcxx Date: Sun, 12 May 2019 01:24:41 -0400 Subject: [PATCH] fix(button): remove animation when a button is rendered This happens when a scroll is made, then it goes to another route, and returns to the previous route with the return button, or when a dialog with a button is opened. --- src/lib/button/button.style.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/button/button.style.ts b/src/lib/button/button.style.ts index d728db85e..9a5cc97b6 100644 --- a/src/lib/button/button.style.ts +++ b/src/lib/button/button.style.ts @@ -60,8 +60,14 @@ export const STYLES = (theme: ThemeVariables) => { }, onFocusByKeyboard: null, animations: { - '&,&::after': { - transition: 'background 375ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, box-shadow 280ms cubic-bezier(.4,0,.2,1) 0ms' + [ + [ '&:hover', + '&:hover::after', + '&:focus', + '&:focus::after', + '{onFocusByKeyboard}' ].join() + ]: { + transition: 'background 375ms cubic-bezier(0.23, 1, 0.32, 1) 0ms, box-shadow 280ms cubic-bezier(.4,0,.2,1) 0ms', } } });