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

add ability to pass an html element to test helpers #1907

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

AmauryD
Copy link
Contributor

@AmauryD AmauryD commented Nov 13, 2023

Related issue : #1557

@@ -45,6 +53,10 @@ export function closeFlatpickrDate(selector) {
* @function clearFlatpickrDate
*/
export function clearFlatpickrDate(selector) {
if (selector instanceof HTMLElement) {
selector._flatpickr.clear(); // eslint-disable-line
Copy link
Owner

Choose a reason for hiding this comment

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

Can we make these set flatpickrInput and then we can keep the rest of the logic as is and not return here?

@AmauryD
Copy link
Contributor Author

AmauryD commented Nov 15, 2023

@RobbieTheWagner I simplified with a ternary operator.

Copy link
Owner

@RobbieTheWagner RobbieTheWagner left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@RobbieTheWagner RobbieTheWagner merged commit 8d800ee into RobbieTheWagner:main Nov 15, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants