Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ayangster committed Oct 2, 2023
1 parent 6eb9f07 commit 668f536
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/state-calculator.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('template spec', () => {
cy.get('rewiring-america-state-calculator')
.shadow()
.find('select#utility')
.should("exist");
.should('exist');

cy.get('rewiring-america-state-calculator')
.shadow()
Expand Down Expand Up @@ -49,6 +49,6 @@ describe('template spec', () => {

cy.get('rewiring-america-state-calculator')
.shadow()
.contains("Other incentives available to you");
.contains('Other incentives available to you');
});
});
8 changes: 1 addition & 7 deletions src/calculator-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,7 @@ const HOUSEHOLD_SIZE_OPTIONS: OptionParam[] = [1, 2, 3, 4, 5, 6, 7, 8].map(
);

export const formTemplate = (
[
zip,
ownerStatus,
householdIncome,
taxFiling,
householdSize,
]: Array<string>,
[zip, ownerStatus, householdIncome, taxFiling, householdSize]: Array<string>,
projects: Array<string>,
showProjectField: boolean,
onSubmit: (e: SubmitEvent) => void,
Expand Down
10 changes: 6 additions & 4 deletions src/state-calculator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ export class RewiringAmericaStateCalculator extends LitElement {

override async firstUpdated() {
// Give the browser a chance to paint
await new Promise((r) => setTimeout(r, 0));
await new Promise(r => setTimeout(r, 0));
const select = this.renderRoot.querySelector('sl-select');
const combobox = this.renderRoot.querySelector('sl-select')?.renderRoot.querySelector('div.select__combobox');
const combobox = this.renderRoot
.querySelector('sl-select')
?.renderRoot.querySelector('div.select__combobox');

select?.addEventListener('keydown', event => {
if (event.key === "Tab" && select.open) {
if (event.key === 'Tab' && select.open) {
event.preventDefault();
event.stopPropagation();
select.hide();
Expand All @@ -159,7 +161,7 @@ export class RewiringAmericaStateCalculator extends LitElement {
});

combobox?.addEventListener('keydown', event => {
if (event.key === "Tab" && select?.open) {
if (event.key === 'Tab' && select?.open) {
event.preventDefault();
event.stopPropagation();
select.hide();
Expand Down

0 comments on commit 668f536

Please sign in to comment.