Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Dec 4, 2023
1 parent fd0c6ee commit 9cdc9c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/datepicker/datepicker/datepicker.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ const playStory = async ({ canvasElement }): Promise<void> => {
userEvent.click(toggle);
};

const changeEventHandler = async (event): Promise<void> => {
const changeEventHandler = (event): void => {
const div = document.createElement('div');
div.innerText = `valueAsDate is: ${await event.target.getValueAsDate()}.`;
div.innerText = `valueAsDate is: ${event.target.valueAsDate}.`;
document.getElementById('container-value')?.append(div);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/time-input/time-input.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ const updateFormError = (event: CustomEvent): void => {
}
};

const changeEventHandler = async (event: CustomEvent): Promise<void> => {
const changeEventHandler = (event: CustomEvent): void => {
const target = event.target as SbbTimeInput;
const exampleParent = target.closest('div#example-parent')!;
const div = document.createElement('div');
div.innerText = `value is: ${
(exampleParent.querySelector('#input-id') as HTMLInputElement).value
}; valueAsDate is: ${await target.getValueAsDate()}.`;
}; valueAsDate is: ${target.valueAsDate}.`;
exampleParent.querySelector('#container-value')!.append(div);
};

Expand All @@ -50,7 +50,7 @@ const setValueAsDate = async (event: Event): Promise<void> => {
const exampleParent = target.closest('div#example-parent')!;

const timeInput = exampleParent.querySelector('sbb-time-input')!;
await timeInput.setValueAsDate(new Date());
timeInput.valueAsDate = new Date();

const input = exampleParent.querySelector('#input-id') as HTMLInputElement;
input.dispatchEvent(new Event('change')); // Trigger change to update invalid state
Expand Down

0 comments on commit 9cdc9c5

Please sign in to comment.