Skip to content

Commit

Permalink
Add support for targeting self by default
Browse files Browse the repository at this point in the history
  • Loading branch information
titouanmathis committed Aug 9, 2024
1 parent 0eac076 commit 2951299
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ui/atoms/Action/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ export class Action<T extends BaseProps = BaseProps> extends Base<ActionProps &
return effectCache.get(effect);
}

get targets() {
get targets(): Array<Record<string, Base>> {
const { target } = this.$options;

if (!target) {
return [{ [this.__config.name]: this }];
}

const parts = target.split(' ').map((part) => {
const [, name, , selector] = part.match(TARGET_REGEX) ?? [];
return [name, selector];
Expand Down

0 comments on commit 2951299

Please sign in to comment.