diff --git a/CHANGELOG.md b/CHANGELOG.md index 88b44a4b..d513365a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix template preview by @vadimkerr ([#3937](https://github.com/grafana/oncall/pull/3937)) +- Fix an issue when dragging the rotation form ([#3986](https://github.com/grafana/oncall/pull/3986)) ## v1.3.106 (2024-02-20) diff --git a/grafana-plugin/src/containers/RotationForm/RotationForm.tsx b/grafana-plugin/src/containers/RotationForm/RotationForm.tsx index d5cd251e..de21b9f8 100644 --- a/grafana-plugin/src/containers/RotationForm/RotationForm.tsx +++ b/grafana-plugin/src/containers/RotationForm/RotationForm.tsx @@ -716,10 +716,11 @@ export const RotationForm = observer((props: RotationFormProps) => { return; } + const scrollBarReferenceElements = document.querySelectorAll('.scrollbar-view'); // top navbar display has 2 scrollbar-view elements (navbar & content) - const baseReferenceEl = document.querySelectorAll('.scrollbar-view')[1]; - - const baseReferenceElRect = baseReferenceEl.getBoundingClientRect(); + const baseReferenceElRect = ( + scrollBarReferenceElements.length === 1 ? scrollBarReferenceElements[0] : scrollBarReferenceElements[1] + ).getBoundingClientRect(); const { right, bottom } = baseReferenceElRect;