File tree Expand file tree Collapse file tree
resources/js/components/fieldtypes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040<script >
4141import Fieldtype from ' ./Fieldtype.vue' ;
4242import { Input , Select } from ' @/components/ui' ;
43+ import debounce from ' @/util/debounce.js' ;
44+ import { markRaw } from ' vue' ;
4345
4446export default {
4547 components: { Input, Text , Select },
@@ -60,6 +62,13 @@ export default {
6062 };
6163 },
6264
65+ created () {
66+ this .syncUrlDebounced = markRaw (debounce ((url ) => {
67+ this .update (url);
68+ this .updateMeta ({ ... this .meta , initialUrl: url });
69+ }, 150 ));
70+ },
71+
6372 computed: {
6473 entryValue () {
6574 return this .selectedEntries .length ? ` entry::${ this .selectedEntries [0 ]} ` : null ;
@@ -116,12 +125,11 @@ export default {
116125
117126 urlValue (url ) {
118127 if (this .metaChanging ) return ;
119-
120- this .update (url);
121- this .updateMeta ({ ... this .meta , initialUrl: url });
128+ this .syncUrlDebounced (url);
122129 },
123130
124131 meta (meta , oldMeta ) {
132+ if (meta === oldMeta) return ;
125133 if (JSON .stringify (meta) === JSON .stringify (oldMeta)) return ;
126134
127135 this .metaChanging = true ;
You can’t perform that action at this time.
0 commit comments