-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override constrainToScroll prop default value to false #586
Override constrainToScroll prop default value to false #586
Conversation
@MisRob Hello. Kindly requesting for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kafukoM! Generally, changes look good to me. Just a minor change and we should be good. Thanks
lib/KDropdownMenu.vue
Outdated
// Override default prop value | ||
constrainToScrollParent: { | ||
type: Boolean, | ||
default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, I think this needs to default to true
as is with Keen UI. We can then override the default if we need to by passing false
. This will also ensure that we are backward compatible too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also, 1 or 2 linting issues to take care of. You can fix any linting issues by running yarn run lint-fix
before adding and committing your changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For changelog build failures, please copy the changelog below(I made a few changes to your changelog from the pr) and add it to the CHANGELOG.md
just below the ## Version 3.x.x (release-v3 branch)
section as the latest entry, since your fix is targeting release-v3
- [#586]
- **Description:** Adds a new prop `constrainToScrollParent ` to `KDropdownMenu` to allow overriding of its popover flipping behavior.
- **Products impact:** Bugfix
- **Addresses:** [#432](https://github.com/learningequality/kolibri-design-system/issues/432)
- **Components:** KDropdownMenu
- **Breaking:** no
- **Impacts a11y:** no
- **Guidance:** Use the `constrainToScrollParent` prop to override the default popover flipping behavior of the `KDropdownMenu` component prop where necessary.
[#586]: https://github.com/learningequality/kolibri-design-system/pull/586
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be sure to let me know in case you need any support in the process. Thanks again
lib/KDropdownMenu.vue
Outdated
@@ -34,6 +35,11 @@ | |||
UiMenu, | |||
}, | |||
props: { | |||
// Override default prop value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace this comment with documentation instead
/**
* The dropdown menu popover flips its position to avoid overflows within the parent. Setting it to false disables the flipping behavior.
*/
@MisRob, happy to hear your thoughts if this developer friendly language :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be helpful documentation definitely, thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback @akolson. I have made the requested changes in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean I have to submit another PR showcasing the override for the template in Kolibiri rendering the KDropdownMenu component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we could start by overriding the value in Kolibri: Facility Settings, where the bug was initially caught. Please see #432 for specifics. You can test your KDS changes locally in kolibri by running
yarn run devserver-with-kds /path/to/your/local/kolibri-design-system
The rest of the overrides will be done as and when its needed.
yarn.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to be changing yarn.lock as part of this task. Could you please revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MisRob I have reverted the commit, leaving out the yarn.lock changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kafukoM I think this change on yarn.lock is still present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kafukoM, although It looks like we picked up some conflicts in the process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you are not having some changelog entries. All the below should be present in your version of the changelog
- [#586]
- **Description:** Adds a new prop `constrainToScrollParent ` to `KDropdownMenu` to allow overriding of its popover flipping behavior.
- **Products impact:** Bugfix
- **Addresses:** [#432](https://github.com/learningequality/kolibri-design-system/issues/432)
- **Components:** KDropdownMenu
- **Breaking:** no
- **Impacts a11y:** no
- **Guidance:** Use the `constrainToScrollParent` prop to override the default popover flipping behavior of the `KDropdownMenu` component prop where necessary.
[#586]: https://github.com/learningequality/kolibri-design-system/pull/586
- [#552]
- **Description:** New `KListWithOverflow` component.
- **Products impact:** new API.
- **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/556, https://github.com/learningequality/studio/issues/3423, https://github.com/learningequality/kolibri/issues/11923.
- **Components:** KListWithOverflow.
- **Breaking:** no.
- **Impacts a11y:** no.
- **Guidance:** -.
[#552]: https://github.com/learningequality/kolibri-design-system/pull/552
- [#552]
- **Description:** New `useKResponsiveElement` private composable, `KResponsiveElementMixin` translated to this composable.
- **Products impact:** -.
- **Addresses:** -.
- **Components:** -.
- **Breaking:** no.
- **Impacts a11y:** no.
- **Guidance:** -.
[#552]: https://github.com/learningequality/kolibri-design-system/pull/552
- [#538]
- **Description:** Complete KImg implementation
- **Products impact:** new API
- **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/368
- **Components:** KImg
- **Breaking:** no
- **Impacts a11y:** yes
- **Guidance:** One of the benefits of using KImg is that it throws a11y related warnings
[#538]: https://github.com/learningequality/kolibri-design-system/pull/538
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akolson I have updated my changelog file with the latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kafukoM, the above was only intended as a guide for you when resolving the conflict locally, my apologies for any confusion. Could you please revert your most recent commit and do the following?
git rebase release-v3
orgit merge release-v3
. This will bring in any changes you don't have- Resolve the conflicts,
- commit the changes
- Finally, push
Another more straightforward option would be to undo all changes made in the changelog, then rebase or merge release-v3 into your branch after which you can add the changelog here again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akolson I think my latest commit should have resolved the conflict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit 44409f6.
rather than applying them to <img> in preparation for implementing the image scaling logic.
@MisRob I am happy for this to be merged, if everything is okay on your side :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Great job @kafukoM!
I'll proceed with the merge. |
Okay. Do we need Kolibri follow up issue for this to take effect to be able close this #432 or will the new default value resolve it automatically? |
Ah I see, perfect |
Description
Options dropdown will open downwards as expected.
Issue addressed
Options dropdown opens upwards regardless of available space below.
Addresses #432
Before/after screenshots
BEFORE
AFTER
Changelog
KDropdownMenu
to open downwards when there's sufficient space, improving user experience and interface consistency.KDropdownMenu
component behaves more predictably in various layouts, enhancing UI consistency across applications. No action is needed from consumers aside from updating to the latest version to benefit from this improvement.Steps to test
Testing checklist
After review
CHANGELOG.md