clear highlight state as part of component select
This commit is contained in:
parent
8763f5251c
commit
094881e807
|
@ -5,7 +5,6 @@
|
|||
runtimeToReadableBinding,
|
||||
} from "@/dataBinding"
|
||||
import { builderStore } from "@/stores/builder"
|
||||
import { onDestroy } from "svelte"
|
||||
|
||||
export let label = ""
|
||||
export let labelHidden = false
|
||||
|
@ -79,12 +78,6 @@
|
|||
? defaultValue
|
||||
: enriched
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
if (highlightedSettings) {
|
||||
builderStore.highlightSetting(null)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { onDestroy } from "svelte"
|
||||
import { ActionButton, Modal, ModalContent, Combobox } from "@budibase/bbui"
|
||||
import { getAllStateVariables } from "@/dataBinding"
|
||||
import {
|
||||
|
@ -94,17 +93,10 @@
|
|||
}) {
|
||||
componentStore.select(component.id)
|
||||
|
||||
// Delay highlighting until after component selection and re-render (i know this is disgusting)
|
||||
setTimeout(() => {
|
||||
component.settings.forEach(setting => {
|
||||
builderStore.highlightSetting(setting)
|
||||
})
|
||||
}, 100)
|
||||
component.settings.forEach(setting => {
|
||||
builderStore.highlightSetting(setting)
|
||||
})
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
builderStore.highlightSetting(undefined)
|
||||
})
|
||||
</script>
|
||||
|
||||
<ActionButton on:click={modal.show}>State</ActionButton>
|
||||
|
|
|
@ -20,6 +20,7 @@ import {
|
|||
previewStore,
|
||||
tables,
|
||||
componentTreeNodesStore,
|
||||
builderStore,
|
||||
} from "@/stores/builder"
|
||||
import { buildFormSchema, getSchemaForDatasource } from "@/dataBinding"
|
||||
import {
|
||||
|
@ -716,6 +717,11 @@ export class ComponentStore extends BudiStore<ComponentState> {
|
|||
* @param {string} componentId
|
||||
*/
|
||||
select(componentId: string) {
|
||||
builderStore.update(state => {
|
||||
state.highlightedSettings = null
|
||||
return state
|
||||
})
|
||||
|
||||
this.update(state => {
|
||||
state.selectedComponentId = componentId
|
||||
return state
|
||||
|
|
Loading…
Reference in New Issue