Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: add checked payload type
Browse files Browse the repository at this point in the history
  • Loading branch information
tilmx authored and marionebl committed Sep 10, 2018
1 parent 193506f commit 4f90c41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/model/element-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ export class ElementAction {
return event.target.name;
case 'value':
return event.target.value;
case 'checked':
return event.target.checked;
}
return undefined;
}
Expand Down
9 changes: 5 additions & 4 deletions src/model/pattern-property/event-handler-property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import * as Mobx from 'mobx';
import { deserializeOrigin, PatternPropertyBase, serializeOrigin } from './property-base';
import * as Types from '../../types';

export interface PatternEventInit {
type: Types.PatternEventType;
}

export class PatternEvent {
@Mobx.observable private type: Types.PatternEventType;

Expand All @@ -22,6 +26,7 @@ export class PatternEvent {
case Types.PatternEventType.FocusEvent:
return ['name', 'value'];
case Types.PatternEventType.ChangeEvent:
return ['name', 'checked', 'value'];
case Types.PatternEventType.InputEvent:
return ['name', 'value'];
case Types.PatternEventType.MouseEvent:
Expand Down Expand Up @@ -121,10 +126,6 @@ export class PatternEventHandlerProperty extends PatternPropertyBase<string[]> {
}
}

export interface PatternEventInit {
type: Types.PatternEventType;
}

function deserializeEventType(type: Types.SerializedPatternEventType): Types.PatternEventType {
switch (type) {
case 'FocusEvent':
Expand Down
1 change: 0 additions & 1 deletion src/preview/preview-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export class PreviewStore<V> {
return;
}

e.preventDefault();
elementAction.execute({ sender: this.sender, project: this.getProject(), event: e });
};
} else {
Expand Down

0 comments on commit 4f90c41

Please sign in to comment.