question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to draw interactive (hoverable/clickable) elements inside custom cells

See original GitHub issue

I’m a beginner at using canvas. glide-data-grid introduced me to Canvas API. And I’ve been hugely impressed by both. Thanks for the great library!


We need to draw hoverable/clickable elements inside custom cells. I’m planning to develop a custom reusable solution for this. But before starting to invest in our custom solution, I wanted to ask here if there is anything I should be aware of about this. (e.g. an existing solution or this feature already being developed somewhere else)

We want to use glide-data-grid because of the performance it offers for large data sets, while retaining interactivity on individual cells. And I’m aware of “having clickable/hoverable elements inside individual cells” is not the intended way of using glide-data-grid.

Our requirements

  • Drawing x number of interactive elements inside custom cells
    • x can be anything, we can draw 1 or 5 different interactive elements
    • Each of these elements could be drawn at any position inside the cell (on left, on right, in middle, right next to a text)
    • Each interactive element can have onClick and/or onHover callbacks.
  • This interactive elements solution should be easily reusable for any custom cell

Screenshots from our design to show my motivation to develop such a solution for interactivity image


The proof of concept (really immature) I created for registering clickable elements inside custom cells https://github.com/hashintel/hash/commit/4cd43c6272786fc366a2868bbb8eadc98b65e910

I called the clickable items Clickable, and the solution ClickableManager. But If I decide to advance more on developing my own solution to this, I’m planning to call itInteractableManager

Recording of the proof of concept above:

https://user-images.githubusercontent.com/39553853/199499619-4954cd11-bc48-4ebe-b32d-e5b92300a249.mov


I already developed a less-generic solution for showing tooltips when items inside cells are hovered

Here is the use-grid-tooltip hook https://github.com/hashintel/hash/blob/72a09872f648cd52f200b33aa70446afad84bd4e/packages/hash/frontend/src/components/GlideGlid/utils/use-grid-tooltip.tsx

Preview of use-grid-tooltip below

197561241-bd7588f4-7002-4a07-94b8-662fc017edb1

https://user-images.githubusercontent.com/39553853/199512809-0ba08d28-eb76-4b3a-8680-5766d6fd68d6.mp4

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yusufkinatascommented, Nov 15, 2022

If anybody is interested in seeing how we created an “Interactivity Manager for glide-data-grid custom cells”, check out this PR: https://github.com/hashintel/hash/pull/1386.

@jassmith Thank you so much for suggestions!

0reactions
jassmithcommented, Nov 15, 2022

Check out hte links-cell, it does what you want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are hover states necessary? - User Experience Stack Exchange
The short answer is, yes, we need to have hover states on every button in our interface. And I typically extend that to...
Read more >
Interactive Data Visualization in Python With Bokeh
You'll learn how to: Transform your data into visualizations, using Bokeh; Customize and organize your visualizations; Add interactivity to your visualizations.
Read more >
Is there a way to make a DashTable in Dash non-interactive?
Found the answer through some digging. Insert this into your custom css file that runs on startup .dash-spreadsheet-container ...
Read more >
ARIA: button role - Accessibility - MDN Web Docs
The button role is for clickable elements that trigger a response ... do not have a way of representing semantic elements contained in...
Read more >
Develop Accessibly | Digital Accessibility at Princeton
Creating accessible forms and interactive elements is hard. Whenever possible, use accessible ... Screen readers often do not trigger hover OR focus events....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found