mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
Use uuid for dom widget id (#2947)
This commit is contained in:
@@ -8,7 +8,7 @@ import _ from 'lodash'
|
||||
import { useChainCallback } from '@/composables/functional/useChainCallback'
|
||||
import { app } from '@/scripts/app'
|
||||
import { useDomWidgetStore } from '@/stores/domWidgetStore'
|
||||
import { generateRandomSuffix } from '@/utils/formatUtil'
|
||||
import { generateUUID } from '@/utils/formatUtil'
|
||||
|
||||
export interface DOMWidget<T extends HTMLElement, V extends object | string>
|
||||
extends ICustomWidget<T> {
|
||||
@@ -189,9 +189,9 @@ LGraphNode.prototype.addDOMWidget = function <
|
||||
if (tooltip && !element.title) {
|
||||
element.title = tooltip
|
||||
}
|
||||
|
||||
// Note: Before `LGraphNode.configure` is called, `this.id` is always `-1`.
|
||||
const widget = new DOMWidgetImpl({
|
||||
id: `${this.id}:${name}:${generateRandomSuffix()}`,
|
||||
id: generateUUID(),
|
||||
node: this,
|
||||
name,
|
||||
type,
|
||||
|
||||
Reference in New Issue
Block a user