From 5f9af58dbfd0c1fe5225bbd86ce66c9910ac6464 Mon Sep 17 00:00:00 2001 From: Alex Velez Date: Fri, 24 May 2024 13:37:37 -0500 Subject: [PATCH] Remove unused changes --- CHANGELOG.md | 6 +++--- lib/KModal.vue | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3249dad0c..d430b8fa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,13 @@ Changelog is rather internal in nature. See release notes for the public overvie ## Upcoming version 5.x.x (`develop` branch) - [#590] - - **Description:** Modal now resizes dynamically to adjust size based on content changes. + - **Description:** Modal now shrinks when the content has a smaller height. - **Products impact:** bugfix. - **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/570 - **Components:** KModal. - - **Breaking:** No + - **Breaking:** no - **Impacts a11y:** - - - **Guidance:** Consumers need to ensure the modal content is wrapped correctly for the resizing logic to work effectively. No additional steps required for integration. + - **Guidance:** Consumers need to ensure the modal height is still working correctly. [#590]: https://github.com/learningequality/kolibri-design-system/pull/590/ diff --git a/lib/KModal.vue b/lib/KModal.vue index e01a8062c..829dfecb6 100644 --- a/lib/KModal.vue +++ b/lib/KModal.vue @@ -281,12 +281,14 @@ this.$refs.title.clientHeight - this.$refs.actions.clientHeight - 32; + // to prevent max height from toggling between pixels // we set a threshold of how many pixels the height should change before we update if (Math.abs(maxContentHeightCheck - this.maxContentHeight) >= 8) { this.maxContentHeight = maxContentHeightCheck; this.scrollShadow = this.maxContentHeight < this.$refs.content.scrollHeight; } + // make sure that overflow-y won't be updated to 'auto' if this function is running for the first time // (otherwise Firefox would add a vertical scrollbar right away) + don't apply if modal contains KSelect // (otherwise KSelect will be trapped inside modal if KSelect is opened a second time) @@ -298,7 +300,6 @@ } } }, 50), - emitCancelEvent() { if (!this.cancelDisabled) { /**