Skip to content

Commit 814bdcc

Browse files
nielslyngsoeiOvergaard
andauthoredMay 12, 2023
feat: change events to align with native browser behavior (#476)
* remove bubbles and composed from UUIEvent * list events * UUIButtonInlineCreateEvent * all change events * inner-slot-change * UUIFileDropzoneEvent * Icon + MenuItem * UUIToastNotificationEvent * UUIFormControlEvent not composed * added missing imports * change into a MarkDown table * Cancelable Selectable Event * update dropzone story to accept props and log actions --------- Co-authored-by: Jacob Overgaard <[email protected]>
1 parent b49a238 commit 814bdcc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+433
-114
lines changed
 

‎docs/EVENTS.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Events
2+
3+
**Change in version 1.3.0**
4+
In version 1.3.0 the events Bubbles and Composed properties has changed, here is a list of events and the change of them:
5+
6+
| Name | Bubbles | Composed | Description |
7+
| ------------------------- | ------- | -------- | ----------------------------------------------------------------------------------- |
8+
| UUIEvent | No | No | No longer bubbles or composed by default. |
9+
| UUIFormControlEvent | Yes | No | No longer composed. |
10+
| UUISelectableEvent | Yes | No | No longer composed. |
11+
| UUIBooleanInputEvent | Yes | No | No longer composed. |
12+
| UUIButtonInlineEvent | Yes | Yes | Not affected. |
13+
| UUICardEvent | No | No | No longer bubbles or composed. |
14+
| UUIColorAreaEvent(s) | Yes | No | No longer composed. |
15+
| UUIColorPickerEvent(s) | Yes | No | No longer composed. |
16+
| UUIColorSliderEvent(s) | Yes | No | No longer composed. |
17+
| UUIColorSwatchesEvent(s) | Yes | No | No longer composed. |
18+
| UUIComboboxEvent | Yes | No | No longer composed. |
19+
| UUIComboboxListEvent | Yes | No | The event name 'slot-change' is changed to 'inner-slot-change'. No longer composed. |
20+
| UUIFileDropzoneEvent(s) | Yes | No | The event name 'file-change' is changed to 'change'. No longer composed. |
21+
| UUIIconRequestEvent | Yes | Yes | Not affected. |
22+
| UUIInputEvent | Yes | No | No longer composed. |
23+
| UUIMenuItemEvent | No | No | No longer bubbles or composed. |
24+
| UUIPaginationEvent | Yes | No | No longer composed. |
25+
| UUIPopoverEvent | No | No | No longer bubbles or composed. |
26+
| UUIRadioEvent | Yes | No | No longer composed. |
27+
| UUIRadioGroupEvent | Yes | No | No longer composed. |
28+
| UUIRangeSliderEvent | Yes | No | No longer composed. |
29+
| UUIRefEvent | No | No | No longer bubbles or composed. |
30+
| UUISelectEvent | Yes | No | No longer composed. |
31+
| UUISliderEvent(s) | Yes | No | No longer composed. |
32+
| UUITabEvent | No | No | No one is dispatching this class. |
33+
| UUITabGroupEvent | No | No | No one is dispatching this class. |
34+
| UUITextAreaEvent | Yes | No | No longer composed. |
35+
| UUIToastNotificationEvent | No | No | No longer bubbles or composed. |
36+
37+
Also notice events files previously named with a 's' in the end is no longer named this way, they are without the 's' now. (notice only affects direct paths)

‎packages/uui-base/lib/events/UUIEvent.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
* Umbraco UI implementation of native DOM CustomEvent that propagates out of Shadow DOM context.
33
*/
44

5-
const DefaultInit = {
6-
composed: true,
7-
bubbles: true,
8-
};
95
export class UUIEvent<
106
DetailType extends Record<string, any> = Record<string, any>,
117
EventTargetType extends EventTarget | null = EventTarget | null
@@ -14,10 +10,7 @@ export class UUIEvent<
1410
readonly target!: EventTargetType;
1511

1612
constructor(evName: string, eventInit: any | null = {}) {
17-
super(evName, {
18-
...DefaultInit,
19-
...eventInit,
20-
});
13+
super(evName, { ...eventInit });
2114
this.detail = eventInit.detail || {};
2215
}
2316
}

0 commit comments

Comments
 (0)