Skip to content

Commit

Permalink
misc(treemap): update colors on enter keypress (#12496)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed May 17, 2021
1 parent d455ac3 commit fe4cced
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lighthouse-treemap/app/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ class TreemapViewer {
this.updateColors();
});

treemapEl.addEventListener('keypress', (e) => {
if (!(e instanceof KeyboardEvent)) return;

if (e.key === 'Enter') this.updateColors();
});

treemapEl.addEventListener('mouseover', (e) => {
if (!(e.target instanceof HTMLElement)) return;
const nodeEl = e.target.closest('.webtreemap-node');
Expand Down

0 comments on commit fe4cced

Please sign in to comment.