-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kanban embed view #179
Kanban embed view #179
Conversation
<div | ||
className="absolute top-0 right-0 h-20 w-24 z-20" | ||
// if this is set to the main div, mouse events on CellEmbed cause re-renders | ||
onMouseEnter={() => { | ||
if (!showInterface) setShowMenuIcons(true); | ||
}} | ||
onMouseLeave={() => { | ||
if (!showInterface) setShowMenuIcons(false); | ||
}} | ||
> | ||
{onRefresh && ( | ||
<Tooltip content={"Refresh Results"}> | ||
<Button icon={"refresh"} minimal onClick={() => onRefresh()} /> | ||
</Tooltip> | ||
)} | ||
<Popover | ||
placement="left-end" | ||
isOpen={moreMenuOpen} | ||
target={ | ||
<Button | ||
minimal | ||
icon={"more"} | ||
className={isMenuIconDirty ? "roamjs-item-dirty" : ""} | ||
/> | ||
} | ||
onInteraction={(next, e) => { | ||
if (!e) return; | ||
const target = e.target as HTMLElement; | ||
if ( | ||
target.classList.contains("bp3-menu-item") || | ||
target.closest(".bp3-menu-item") | ||
) { | ||
return; | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixed a separate issue where any ResultsView
mode would re-render multiple times when moving the mouse over the component. This was mostly fixed by changing onMouseOver
/onMouseOut
to onMouseEnter
/onMouseLeave
Unfortunately, hovering over an embed (in table or kanban mode) would still trigger this. I tried adding all stopPropagation()
to all mouse events on the div containing the embed, but that didn't fix it. Thus the additional div
with className="absolute top-0 right-0 h-20 w-24 z-20"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
video showing the initial render issue and the trial of stopPropagation()
as a fix
src/components/Kanban.tsx
Outdated
const uid = kanbanCard?.getAttribute("data-uid"); | ||
if (!uid) return; | ||
|
||
const isOpen = target.classList.contains("rm-caret-open"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see if there's a way to get this from roamAlphaAPI
PR for client testing. Waiting on roamAlphaAPI to add
open?
dev docsTestable at: https://relemma-git-renderblockadditions.roamresearch.com/
https://www.loom.com/share/431502557a0e48cc88ab09d0c0cc7a43