-
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
Add KFocusTrap and use it in KModal #799
Add KFocusTrap and use it in KModal #799
Conversation
Co-authored-by: Michaela Robosova <[email protected]>
…ed inside KRadioButtonGroup
revert changes made to KModal and remove KFocustrap for the time being
This reverts commit ec0e778.
hey @MisRob i added the documentation page but i cant find a way to add info to the props as it was auto-generated i tried adding comments in the main code but it still didint show up in the documentation page , how can i add info to these parts of the documentation page |
Hi @lokesh-sagi125, thank you.
Running the development server with I see props documented properly, but events and slots are missing. Please inspect the |
@akolson @AlexVelezLl I am linking the previous PR with review #764 that this PR is expected to have resolved, notably #764 (comment) |
Related Kolibri PR learningequality/kolibri#12718 |
@AlexVelezLl feel free to review if you wish, I just removed you because I wanted to align reviewers with the related Kolibri PR #799 and I think you're already taking care of another reviews :) |
Regarding releases, this won't be a breaking change, however a bit of planning as of when to merge it, depending on the state of the Kolibri PR, may be needed - cc @AlexVelezLl |
lib/KFocusTrap.vue
Outdated
}, | ||
/** | ||
* Emits an event to notify the parent component to focus the first element. | ||
*/ |
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.
The description for the shouldFocusFirstEl
event is not showing up in the docs. Please move it inside the function just above this.$emit(...)
lib/KFocusTrap.vue
Outdated
}, | ||
/** | ||
* Emits an event to notify the parent component to focus the last element. | ||
*/ |
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.
The description for the shouldFocusLastEl
event is not showing up in the docs. Please move it inside the function just above this.$emit(...)
lib/KFocusTrap.vue
Outdated
@focus="handleFirstTrapFocus" | ||
></div> | ||
|
||
<!-- Default slot where the focusable content will be rendered --> |
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 should be the below so that the description for the slot is added in the component's documentation. I've added @slot
.
<!-- @slot Default slot where the focusable content will be rendered -->
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.
The code changes look correct to me. I have left some comments to fix some issues with the documentation. Thanks @lokesh-sagi125
@lokesh-sagi125 also please remember to run the below before you commit your changes so that the linting issues are also resolved. Thanks
|
hey @akolson i have made changes to the 'KFocusTrap' component according to your guidance and all the functions are documented now |
Hi @lokesh-sagi125, the linting issues are particularly reported in the below; Kolibri Linter: Linting errors for lib/KFocusTrap.vue
Kolibri Linter: L14 |
Kolibri Linter: ^ Please use space for indentation and keep 2 length. (space-tab-mixed-disabled)
Kolibri Linter: L28 |<script>
Kolibri Linter: ^ Need two endlines between top-level tags. (--vue-component-conventions)
Kolibri Linter: L107 |<style scoped>
Kolibri Linter: ^ Need two endlines between top-level tags. (--vue-component-conventions) Maybe manually adding the endlines and space as advised above could help? |
yes @akolson i did try manually adding the two endlines and the indentation , but it gets formatted once i run 'yarn lint-fix' or run the devserver |
@lokesh-sagi125 reformat but don't run the |
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.
Just higlighted the needed changes to fix the linting issues :). Our current linter gets a bit confused when there aren't two lines between the main template
, script
and style
blocks.
Co-authored-by: Alex Velez <[email protected]>
Co-authored-by: Alex Velez <[email protected]>
Co-authored-by: Alex Velez <[email protected]>
hey @AlexVelezLl i did commit the changes you suggested and it seems to have solved the linting issue. |
hi @AlexVelezLl i have come across this article , https://medium.com/learning-equality/gsoc-24-my-journey-as-a-contributor-at-learning-equality-4ed4c623b189 and was aiming to go down a similar path , how can i join the slack channel? |
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.
LGTM! Thanks @lokesh-sagi125. @AlexVelezLl, please feel free to merge whenever you are ready!
Hey @lokesh-sagi125! You can send an email to [email protected] so we can send you the invitation to our slack channel 🤗. Thank you!! |
Description
copy FocusTrap from kolibri into KFocusTrap in the KDS and use it in the KModal
Issue addressed
Add KFocusTrap and use it in KModal #746
Addresses #746
Before/after screenshots
before:-
https://github.com/user-attachments/assets/c38be827-683f-4d45-86b2-e845a2193744
after:-
https://github.com/user-attachments/assets/b5b27ea8-0d12-42fa-8fff-2de408a4eeb3
Changelog