Check if base element exists when dragging the rotation form (#3986)
# What this PR does Right now depending on whether the left bar is pinned or not, the existing base element (this is to determine the dragging margins) query might fail if it cannot find the expected element. Added a check to see whether it exists or not.
This commit is contained in:
parent
20973705e9
commit
3a76892df8
2 changed files with 5 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -716,10 +716,11 @@ export const RotationForm = observer((props: RotationFormProps) => {
|
|||
return;
|
||||
}
|
||||
|
||||
const scrollBarReferenceElements = document.querySelectorAll<HTMLElement>('.scrollbar-view');
|
||||
// top navbar display has 2 scrollbar-view elements (navbar & content)
|
||||
const baseReferenceEl = document.querySelectorAll<HTMLElement>('.scrollbar-view')[1];
|
||||
|
||||
const baseReferenceElRect = baseReferenceEl.getBoundingClientRect();
|
||||
const baseReferenceElRect = (
|
||||
scrollBarReferenceElements.length === 1 ? scrollBarReferenceElements[0] : scrollBarReferenceElements[1]
|
||||
).getBoundingClientRect();
|
||||
|
||||
const { right, bottom } = baseReferenceElRect;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue