@@ -76,18 +76,27 @@ export class UmbPropertyEditorUIBlockGridElement extends UmbLitElement implement
76
76
// TODO: Prevent initial notification from these observes:
77
77
this . observe ( this . #context. layouts , ( layouts ) => {
78
78
this . _value = { ...this . _value , layout : { [ UMB_BLOCK_GRID_PROPERTY_EDITOR_ALIAS ] : layouts } } ;
79
- this . dispatchEvent ( new UmbPropertyValueChangeEvent ( ) ) ;
79
+ this . #fireChangeEvent ( ) ;
80
80
} ) ;
81
81
this . observe ( this . #context. contents , ( contents ) => {
82
82
this . _value = { ...this . _value , contentData : contents } ;
83
- this . dispatchEvent ( new UmbPropertyValueChangeEvent ( ) ) ;
83
+ this . #fireChangeEvent ( ) ;
84
84
} ) ;
85
85
this . observe ( this . #context. settings , ( settings ) => {
86
86
this . _value = { ...this . _value , settingsData : settings } ;
87
- this . dispatchEvent ( new UmbPropertyValueChangeEvent ( ) ) ;
87
+ this . #fireChangeEvent ( ) ;
88
88
} ) ;
89
89
}
90
90
91
+ #debounceChangeEvent?: boolean ;
92
+ #fireChangeEvent = async ( ) => {
93
+ if ( this . #debounceChangeEvent) return ;
94
+ this . #debounceChangeEvent = true ;
95
+ await Promise . resolve ( ) ;
96
+ this . dispatchEvent ( new UmbPropertyValueChangeEvent ( ) ) ;
97
+ this . #debounceChangeEvent = false ;
98
+ } ;
99
+
91
100
protected firstUpdated ( _changedProperties : PropertyValueMap < any > | Map < PropertyKey , unknown > ) : void {
92
101
super . firstUpdated ( _changedProperties ) ;
93
102
0 commit comments