-
Notifications
You must be signed in to change notification settings - Fork 329
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
Conversation
BREAKING CHANGE
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:
|
@@ -18,9 +18,9 @@ export interface AutocompleteAccessibilityGetters< | |||
|
|||
export type GetEnvironmentProps = (props: { | |||
[key: string]: unknown; | |||
searchBoxElement: HTMLElement; | |||
panelElement: HTMLElement; | |||
formElement: HTMLElement; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this 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
This renames the
getEnvironmentProps
param fromsearchBoxElement
toformElement
, which fits better the other namings (e.g.,getFormProps
).BREAKING CHANGE.