https://discord.umbraco.com logo
Anyone built up their own uui-ref-node
# package-development
t
Anyone built up their own uui-ref-node for their packages before? Trying to do it for a package and noticing a quirky little thing where I can select the next inside of that web component without actually triggering the "selected event" Wondering if I may be hitting a pitfall 😛 https://cdn.discordapp.com/attachments/882984798719729704/1469007286662987859/image.png?ex=6986bfe5&is=69856e65&hm=4dc8266c5c65b182877643c0c088ddd8bdd0f3dd741ebc58df2260f3182ab381&
m
not used it.. but does this help https://github.com/umbraco/Umbraco-CMS/blob/main/src/Umbraco.Web.UI.Client/src/packages/documents/documents/item/document-item-ref.element.ts#L98-L112
Copy code
@selected=${this.#onSelected}
@deselected=${this.#onDeselected}
source here if you need to dig deeper... https://github.com/umbraco/Umbraco.UI/tree/main/packages/uui-ref-node
t
It does and I went digging down some directories in the Umbraco CMS integrations package for Hubspot as I noticed it similarly there. https://github.com/umbraco/Umbraco.Cms.Integrations/blob/main-v17/src/Umbraco.Cms.Integrations.Crm.Hubspot/Client/src/modal/hubspot-forms-modal.element.ts Ironically the Hubspot package also has the same issue where you can select the text without triggering the event. Going down a rabbit hole of issues, I noticed a similar issue reported on https://github.com/umbraco/Umbraco.UI/issues/1052 Which links off to a Forms Fix where Ronald mentioned they had fixed it in Forms to use the open event instead of the selectable event. added in an @open event and presto, clicks on text react like a selected event as well!
m
I wonder it its by design? bit like the listview/collection where the name is reserved for open, and clicking anywhere else is select (as well as the checkbox)?
It's like it in the media/node picker too for folders, click the name and you open into the folder, click anywhwere else and you select the folder...
15 Views