diff --git a/src/components/graph/vueNodes/NodeWidgets.vue b/src/components/graph/vueNodes/NodeWidgets.vue index 30e766da2..aa60ea0c9 100644 --- a/src/components/graph/vueNodes/NodeWidgets.vue +++ b/src/components/graph/vueNodes/NodeWidgets.vue @@ -123,12 +123,11 @@ const simplifiedWidget = (widget: SafeWidgetData): SimplifiedWidget => { // Handle widget value updates const handleWidgetUpdate = (widget: SafeWidgetData, value: unknown) => { - widget.value = value - + // Call LiteGraph callback to update the authoritative state + // The callback will trigger the chained callback in useGraphNodeManager + // which will update the Vue state automatically if (widget.callback) { widget.callback(value) } - - // TODO: Implement proper widget change handling to sync back to LiteGraph } diff --git a/src/components/graph/vueWidgets/WidgetInputText.vue b/src/components/graph/vueWidgets/WidgetInputText.vue index 462957335..0c648d927 100644 --- a/src/components/graph/vueWidgets/WidgetInputText.vue +++ b/src/components/graph/vueWidgets/WidgetInputText.vue @@ -3,7 +3,12 @@ - + @@ -16,14 +21,25 @@ import { INPUT_EXCLUDED_PROPS, filterWidgetProps } from '@/utils/widgetPropFilter' - -const value = defineModel({ required: true }) +import { useStringWidgetValue } from '@/composables/graph/useWidgetValue' const props = defineProps<{ widget: SimplifiedWidget + modelValue: string readonly?: boolean }>() +const emit = defineEmits<{ + 'update:modelValue': [value: string] +}>() + +// Use the composable for consistent widget value handling +const { localValue, onChange } = useStringWidgetValue( + props.widget, + props.modelValue, + emit +) + const filteredProps = computed(() => filterWidgetProps(props.widget.options, INPUT_EXCLUDED_PROPS) ) diff --git a/src/components/graph/vueWidgets/WidgetSelect.vue b/src/components/graph/vueWidgets/WidgetSelect.vue index 2639c2e64..fd6ad317c 100644 --- a/src/components/graph/vueWidgets/WidgetSelect.vue +++ b/src/components/graph/vueWidgets/WidgetSelect.vue @@ -4,10 +4,11 @@ widget.name }}