MCPcopy Create free account
hub / github.com/editablejs/editable / handleSelect

Function handleSelect

packages/ui/src/menu.tsx:407–419  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405 const isPointerDownRef = React.useRef(false)
406
407 const handleSelect = () => {
408 const menuItem = ref.current
409 if (!disabled && menuItem) {
410 const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true })
411 menuItem.addEventListener(ITEM_SELECT, event => onSelect?.(event), { once: true })
412 dispatchDiscreteCustomEvent(menuItem, itemSelectEvent)
413 if (itemSelectEvent.defaultPrevented) {
414 isPointerDownRef.current = false
415 } else {
416 rootContext.onClose()
417 }
418 }
419 }
420
421 return (
422 <MenuItemImpl

Callers

nothing calls this directly

Calls 2

onSelectFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…