Skip to content

Commit

Permalink
fix(ui5-color-palette): rename change event (#3429)
Browse files Browse the repository at this point in the history
Part of #3107

BREAKING_CHANGE: change event of ui5-color-palette is renamed to item-click
  • Loading branch information
fifoosid committed Jun 15, 2021
1 parent cf1b64d commit b1e2eaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions packages/main/src/ColorPalette.js
Expand Up @@ -79,9 +79,10 @@ const metadata = {
*
* @event
* @public
* @since 1.0.0-rc.15
* @param {String} color the selected color
*/
change: {
"item-click": {
details: {
color: {
type: String,
Expand Down Expand Up @@ -196,7 +197,7 @@ class ColorPalette extends UI5Element {
}
}

this.fireEvent("change", {
this.fireEvent("item-click", {
color: this._selectedColor,
});
}
Expand Down
8 changes: 5 additions & 3 deletions packages/main/test/pages/ColorPalette.html
Expand Up @@ -58,7 +58,7 @@
<br/>
<br/>
<br/>
<ui5-input id="changeResult" value="Nothing selected"></ui5-input>
<ui5-input id="itemClickResult" value="Nothing selected"></ui5-input>
<br>
<ui5-button id="colorPaletteBtn" >Open ColorPalette</ui5-button>
<ui5-responsive-popover id="respPopover" with-padding>
Expand Down Expand Up @@ -125,12 +125,14 @@
</ui5-color-palette>

<script>
cp1.addEventListener("change", function(event) {
changeResult.value = event.detail.color;
cp1.addEventListener("item-click", function(event) {
itemClickResult.value = event.detail.color;
});

colorPaletteBtn.addEventListener("click", function(event) {
respPopover.open(colorPaletteBtn);
});

btnClose.addEventListener("click", function(event) {
respPopover.close();
});
Expand Down

0 comments on commit b1e2eaf

Please sign in to comment.