Skip to content

Commit

Permalink
[8.18] [kbn-grid-layout] Disable pointer events on drag + resize (#20…
Browse files Browse the repository at this point in the history
…8647) (#209422)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[kbn-grid-layout] Disable pointer events on drag + resize
(#208647)](#208647)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-03T22:43:24Z","message":"[kbn-grid-layout]
Disable pointer events on drag + resize (#208647)\n\n##
Summary\r\n\r\nThis PR greatly improves the performance of
`kbn-grid-layout` on drag +\r\nresize by disabling pointer events during
these actions. This is\r\nespecially evident when dragging over panels
that have their own mouse\r\nevent listeners.\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/efea4bd0-e950-4d71-8485-f5f123240e5b)\r\n|\r\n![image](https://github.com/user-attachments/assets/15b044b2-521c-4bf5-a6cb-673c3a2affe4)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/7daa6c96-ff38-4336-beb8-e7378445e589)\r\n|\r\n![image](https://github.com/user-attachments/assets/37bb55c8-e757-4311-ab25-cb0c4cd18f58)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/1fbe721d-690f-4a57-aaab-c07f575e5d41)\r\n|\r\n![image](https://github.com/user-attachments/assets/6bdfdd40-9e58-4750-b152-cec2b12065fc)\r\n|\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6cc788c4b17fdb627feeceadd457c425478eefd1","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","performance","Team:Presentation","loe:small","impact:high","v9.0.0","Project:Collapsable
Panels","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[kbn-grid-layout]
Disable pointer events on drag +
resize","number":208647,"url":"https://github.com/elastic/kibana/pull/208647","mergeCommit":{"message":"[kbn-grid-layout]
Disable pointer events on drag + resize (#208647)\n\n##
Summary\r\n\r\nThis PR greatly improves the performance of
`kbn-grid-layout` on drag +\r\nresize by disabling pointer events during
these actions. This is\r\nespecially evident when dragging over panels
that have their own mouse\r\nevent listeners.\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/efea4bd0-e950-4d71-8485-f5f123240e5b)\r\n|\r\n![image](https://github.com/user-attachments/assets/15b044b2-521c-4bf5-a6cb-673c3a2affe4)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/7daa6c96-ff38-4336-beb8-e7378445e589)\r\n|\r\n![image](https://github.com/user-attachments/assets/37bb55c8-e757-4311-ab25-cb0c4cd18f58)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/1fbe721d-690f-4a57-aaab-c07f575e5d41)\r\n|\r\n![image](https://github.com/user-attachments/assets/6bdfdd40-9e58-4750-b152-cec2b12065fc)\r\n|\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6cc788c4b17fdb627feeceadd457c425478eefd1"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208647","number":208647,"mergeCommit":{"message":"[kbn-grid-layout]
Disable pointer events on drag + resize (#208647)\n\n##
Summary\r\n\r\nThis PR greatly improves the performance of
`kbn-grid-layout` on drag +\r\nresize by disabling pointer events during
these actions. This is\r\nespecially evident when dragging over panels
that have their own mouse\r\nevent listeners.\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/efea4bd0-e950-4d71-8485-f5f123240e5b)\r\n|\r\n![image](https://github.com/user-attachments/assets/15b044b2-521c-4bf5-a6cb-673c3a2affe4)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/7daa6c96-ff38-4336-beb8-e7378445e589)\r\n|\r\n![image](https://github.com/user-attachments/assets/37bb55c8-e757-4311-ab25-cb0c4cd18f58)\r\n|\r\n|\r\n![image](https://github.com/user-attachments/assets/1fbe721d-690f-4a57-aaab-c07f575e5d41)\r\n|\r\n![image](https://github.com/user-attachments/assets/6bdfdd40-9e58-4750-b152-cec2b12065fc)\r\n|\r\n\r\n###
Checklist\r\n\r\n- [x] The PR description includes the appropriate
Release Notes section,\r\nand the correct `release_note:*` label is
applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"6cc788c4b17fdb627feeceadd457c425478eefd1"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
  • Loading branch information
kibanamachine and Heenawter authored Feb 4, 2025
1 parent 73469a5 commit e0eff95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ export const GridHeightSmoother = ({

if (!interactionEvent) {
smoothHeightRef.current.style.minHeight = `${dimensions.height}px`;
smoothHeightRef.current.style.userSelect = 'auto';
return;
}

smoothHeightRef.current.style.minHeight = `${
smoothHeightRef.current.getBoundingClientRect().height
}px`;
smoothHeightRef.current.style.userSelect = 'none';
});

return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ export const GridLayout = ({
css={css`
padding: calc(var(--kbnGridGutterSize) * 1px);
// disable pointer events and user select on drag + resize
&:has(.kbnGridPanel--active) {
user-select: none;
pointer-events: none;
}
&:has(.kbnGridPanel--expanded) {
${expandedPanelStyles}
}
Expand Down

0 comments on commit e0eff95

Please sign in to comment.