-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: (Core) introduce Action sheet component #3596
Conversation
Deploy preview for fundamental-ngx ready! Built with commit e407ca8 |
apps/docs/src/app/core/component-docs/action-sheet/action-sheet-docs.component.html
Outdated
Show resolved
Hide resolved
libs/core/src/lib/action-sheet/action-sheet-item/action-sheet-item.component.html
Outdated
Show resolved
Hide resolved
Because this is essentially a list, I believe the items should be keyboard navigable |
We need a way to close the mobile view |
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.
Code looks good, just needs some small changes, see comments
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 totally agree with mike, that you should also add some keyboard support. Key Up/Down + anytime popover is opened the first option shoudl be focused
apps/docs/src/app/core/component-docs/action-sheet/action-sheet-docs.component.html
Outdated
Show resolved
Hide resolved
...-docs/action-sheet/examples/action-sheet-compact/action-sheet-compact-example.component.html
Outdated
Show resolved
Hide resolved
...nt-docs/action-sheet/examples/action-sheet-compact/action-sheet-compact-example.component.ts
Outdated
Show resolved
Hide resolved
...omponent-docs/action-sheet/examples/action-sheet-cosy/action-sheet-cosy-example.component.ts
Outdated
Show resolved
Hide resolved
...nent-docs/action-sheet/examples/action-sheet-mobile/action-sheet-mobile-example.component.ts
Outdated
Show resolved
Hide resolved
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.
Awesome work! The rest of the reviewers should verify if their requested changes have been addressed but from my part it looks great.
apps/docs/src/app/documentation/utilities/consts/mobile-mode-configuration-tokens.ts
Outdated
Show resolved
Hide resolved
libs/core/src/lib/action-sheet/action-sheet-item/action-sheet-item.component.ts
Outdated
Show resolved
Hide resolved
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 @katekozlowska I added some comments, also one of the buttons in compact mode doesn't close popover, even if it has [isCloseButton]="true"
libs/core/src/lib/action-sheet/action-sheet-mobile/action-sheet-mobile.component.ts
Outdated
Show resolved
Hide resolved
libs/core/src/lib/action-sheet/action-sheet-mobile/action-sheet-mobile.component.ts
Outdated
Show resolved
Hide resolved
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 found some leftovers / unguarded subscription. After addressing it, we should be good to go with this PR
this._onDestroy$.next(); | ||
this._onDestroy$.complete(); | ||
this.actionSheetControl.clicked.unsubscribe(); | ||
// this.actionSheetItems.unsubscribe(); |
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.
leftover
|
||
/** @hidden */ | ||
private _actionItemsHandle(): void { | ||
this.actionSheetItems.forEach(item => item.clicked.subscribe((isOpen) => this.isOpenChangeHandle(isOpen)) |
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 you unsubscribe after destroy there? You can do it by adding .pipe(takeUntil(this._onDestroy$))
like in other places in code
|
||
/** @hidden */ | ||
private _actionControlHandle(): void { | ||
this.actionSheetControl.clicked.subscribe((isOpen) => this.isOpenChangeHandle(isOpen)); |
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 you unsubscribe after destroy there? You can do it by adding .pipe(takeUntil(this._onDestroy$)) like in other places in code
ngOnDestroy(): void { | ||
this._onDestroy$.next(); | ||
this._onDestroy$.complete(); | ||
this.actionSheetControl.clicked.unsubscribe(); |
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'm not sure if it's going to work. After checking my other comment about unsubscribing you would be able to remove this line
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 🚀
Please provide a link to the associated issue.
closes 3372
Please provide a brief summary of this pull request.
Introduce core action sheet component
Please check whether the PR fulfills the following requirements
https://github.com/SAP/fundamental-ngx/blob/master/CONTRIBUTING.md
https://github.com/SAP/fundamental-ngx/wiki/PR-Review-Checklist
Documentation checklist: