Skip to content

Placeholder attribute and custom event#39

Open
toddwelstein wants to merge 1 commit intojcgertig:masterfrom
toddwelstein:master
Open

Placeholder attribute and custom event#39
toddwelstein wants to merge 1 commit intojcgertig:masterfrom
toddwelstein:master

Conversation

@toddwelstein
Copy link
Copy Markdown

Added a "placeholder" attribute on the element, whose value equals the date format string. This produces a visual result similar to Chrome's native date picker.

Added a custom event listener, which executes the "addPickers" function. This is useful for React applications, because elements can dynamically appear in the DOM before the "mousedown" listener gets triggered. Instead of waiting for a mousedown to occur, the React app can fire the custom event and thereby trigger the polyfill to initialize.

bcomnes added a commit to little-core-labs/date-input-polyfill that referenced this pull request Nov 3, 2020
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.

1 participant