Skip to content

Commit 73120ba

Browse files
committed
Update shouldShowScrollbar condition
Signed-off-by: Akshat Patel <[email protected]>
1 parent 689d467 commit 73120ba

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/modal/modal.component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,13 @@ export class Modal implements AfterViewInit, OnChanges, OnDestroy {
129129
*/
130130
get shouldShowScrollbar() {
131131
const modalContent = this.modal ? this.modal.nativeElement.querySelector(".bx--modal-content") : null;
132-
if (modalContent) {
133-
// get rounded value from height to match integer returned from scrollHeight
134-
const modalContentHeight = Math.ceil(modalContent.getBoundingClientRect().height);
135-
const modalContentScrollHeight = modalContent.scrollHeight;
136-
return modalContentScrollHeight > modalContentHeight;
137-
} else {
132+
if (!modalContent) {
138133
return false;
139134
}
135+
// get rounded value from height to match integer returned from scrollHeight
136+
const modalContentHeight = Math.ceil(modalContent.getBoundingClientRect().height);
137+
const modalContentScrollHeight = modalContent.scrollHeight;
138+
return modalContentScrollHeight > modalContentHeight;
140139
}
141140
/**
142141
* Size of the modal to display.

0 commit comments

Comments
 (0)