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

Required has no tooltip #22

Open
eljeffeg opened this issue Nov 4, 2020 · 3 comments
Open

Required has no tooltip #22

eljeffeg opened this issue Nov 4, 2020 · 3 comments

Comments

@eljeffeg
Copy link

eljeffeg commented Nov 4, 2020

Normally, if an input field is required and the user does not supply a value, the form is not submitted and a tooltip is displayed stating the field is required. However, pretty-dropdowns appears to hide the tooltip. So if the field is required, the user is not notified and the form doesn't submit, leaving the user confused.

@eljeffeg
Copy link
Author

eljeffeg commented Nov 4, 2020

I think a possible fix might be to set the CSS for the required. It works, but I'm just not sure if that affects the parent in any way or if it just applies to the tooltip.

.prettydropdown :required {
  visibility: visible !important;
}

@realmocaccino
Copy link

realmocaccino commented Oct 22, 2022

A better implementation would be:

$select.on('invalid', function() {
  $select.css('visibility', 'visible');
  setTimeout(function() {
    $select.css('visibility', 'hidden');
  }, 5000);
});

@realmocaccino
Copy link

#25 I have sent a Pull Request.

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

No branches or pull requests

2 participants