-
Notifications
You must be signed in to change notification settings - Fork 278
chore(ui5-toolbar): toolbar item wrapper introduced #12243
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
base: main
Are you sure you want to change the base?
Conversation
…nto poc-toolbar-item
@@ -60,6 +74,17 @@ class ToolbarItem extends UI5Element { | |||
@property({ type: Boolean }) | |||
isOverflowed: boolean = 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.
duplicated comment
packages/main/src/ToolbarItem.ts
Outdated
@@ -16,13 +20,23 @@ type ToolbarItemEventDetail = { | |||
bubbles: true, | |||
}) | |||
|
|||
@event("click", { |
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.
do we need this click event?
@@ -107,10 +132,27 @@ class ToolbarItem extends UI5Element { | |||
}, | |||
}; | |||
} | |||
|
|||
constructor() { | |||
super(); |
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.
since the constructor doesn't handle any arguments, this override can be omitted
packages/main/src/ToolbarItem.ts
Outdated
* If `preventOverflowClosing` is false, it will fire a "close-overflow" event. | ||
*/ | ||
onClick(e: Event): void { | ||
e.stopImmediatePropagation(); |
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.
We stop the propagation here which may lead to apps not being able to handle the click event on a higher level container. If possible, let's try to avoid that.
|
||
export default function ToolbarItemTemplate(this: ToolbarItem) { | ||
return ( | ||
<div onClick={this.onClick}> |
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.
Once we have a sample with different types of components we should test if this click only event handling is enough to manage the closing of the popover. If not we should extend it or think of another mehanism.
@@ -0,0 +1,68 @@ | |||
<!DOCTYPE html> |
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.
Let's add other components : Title, Text, Input, CheckBox, ToggleButton, DIV
…nto poc-toolbar-item
No description provided.