Skip to content

Commit 9dbd54d

Browse files
committed
fix transition on buttons, fix re-renders
1 parent d727100 commit 9dbd54d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/components/design-library-list/editor.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
.stk-block-design__edit-btn-container {
5858
opacity: 0;
5959
z-index: 2;
60-
transition: opacity 0.4s cubic-bezier(0.2, 0.6, 0.4, 1);
60+
transition: opacity 0.4s cubic-bezier(0.2, 0.6, 0.4, 1), visibility 0.4s cubic-bezier(0.2, 0.6, 0.4, 1);
6161
position: absolute;
6262
padding: 60px 30px 30px;
6363
background: linear-gradient(180deg, transparent, #fffe 40px, #fff) !important;
@@ -86,7 +86,10 @@
8686
visibility: visible;
8787
opacity: 1;
8888
transition-delay: 1s;
89-
pointer-events: initial;
89+
90+
.ugb-button-component {
91+
pointer-events: initial;
92+
}
9093
}
9194
}
9295

src/components/modal-design-library/modal.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
useEffect, useState, createContext, useContext, useCallback,
3535
useMemo,
3636
} from '@wordpress/element'
37+
import { useSelect } from '@wordpress/data'
3738
import { applyFilters } from '@wordpress/hooks'
3839
import { sprintf, __ } from '@wordpress/i18n'
3940

@@ -78,7 +79,9 @@ export const ModalDesignLibrary = props => {
7879
const [ selectedContainerScheme, setSelectedContainerScheme ] = useState( '' )
7980
const [ selectedBackgroundScheme, setSelectedBackgroundScheme ] = useState( '' )
8081

81-
const savedPatterns = applyFilters( 'stackable.design-library.patterns', [], selectedTab )
82+
const savedPatterns = useSelect( select => {
83+
return applyFilters( 'stackable.design-library.patterns', [], select )
84+
}, [] )
8285

8386
// For version 4, the default tab is now 'patterns' and for category, we use '' instead of 'All'.
8487
// So we need to update the local storage values here.

0 commit comments

Comments
 (0)