Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): rename searchBoxElement to formElement #374

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

francoischalifour
Copy link
Member

This renames the getEnvironmentProps param from searchBoxElement to formElement, which fits better the other namings (e.g., getFormProps).

BREAKING CHANGE.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ed0004b:

Sandbox Source
@algolia/js-example Configuration

@@ -18,9 +18,9 @@ export interface AutocompleteAccessibilityGetters<

export type GetEnvironmentProps = (props: {
[key: string]: unknown;
searchBoxElement: HTMLElement;
panelElement: HTMLElement;
formElement: HTMLElement;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the form or the form container?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it not be HTMLFormElement then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could restrict it indeed. It's only used to determine if we should close the panel on scroll so I'm not sure how restrictive we should be: https://github.com/algolia/autocomplete.js/blob/ed0004bc107517c4526491d4b959a483689e5acf/packages/autocomplete-core/src/getPropGetters.ts#L52

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not add submit and reset event listeners on the form to prevent default? Or is that somewhere else? In any case, it's not really blocking the PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is coming from getFormProps.

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all right, although I'll leave it up to you whether form element should be HTMLFormElement in the getters & doc

@francoischalifour francoischalifour merged commit 79c4985 into next Nov 23, 2020
@francoischalifour francoischalifour deleted the feat/searchBoxElement-to-formElement branch November 23, 2020 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants