-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(js): introduce Autocomplete Touch (#379)
This introduces a brand new Autocomplete experience on touch devices (mobiles, tablets, etc.). This new experience is available via a media query so that it matches when it's triggered given your website requirements.
- Loading branch information
1 parent
3e2f87b
commit 5cfbdf2
Showing
46 changed files
with
733 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { setProperties } from '../utils'; | ||
|
||
type ElementProps = Record<string, unknown> & { | ||
children?: Node[]; | ||
}; | ||
|
||
export function Element<KParam extends keyof HTMLElementTagNameMap>( | ||
tagName: keyof HTMLElementTagNameMap | HTMLElement, | ||
{ children = [], ...props }: ElementProps | ||
): HTMLElementTagNameMap[KParam] { | ||
const element = | ||
typeof tagName === 'string' | ||
? document.createElement<KParam>(tagName as any) | ||
: tagName; | ||
setProperties(element, props); | ||
|
||
element.append(...children); | ||
|
||
return element as any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.