Skip to content

Commit

Permalink
correct null case
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe committed Jan 9, 2025
1 parent f862736 commit bd456a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Umbraco.Web.UI.Client/src/libs/class-api/class.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export const UmbClassMixin = <T extends ClassConstructor<EventTarget>>(superClas
// Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback.
if (controllerAlias === undefined && callback) {
controllerAlias = simpleHashCode(callback.toString());
} else {
} else if (controllerAlias === null) {
// if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL]
controllerAlias = undefined;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const UmbElementMixin = <T extends HTMLElementConstructor>(superClass: T)
// Fallback to use a hash of the provided method, but only if the alias is undefined and there is a callback.
if (controllerAlias === undefined && callback) {
controllerAlias = simpleHashCode(callback.toString());
} else {
} else if (controllerAlias === null) {
// if value is null, then reset it to undefined. Null is used to explicitly tell that we do not want a controller alias. [NL]
controllerAlias = undefined;
}

Expand Down

0 comments on commit bd456a1

Please sign in to comment.