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

Error if labels are not used is unclear #2

Closed
ccchwang opened this issue May 6, 2019 · 4 comments
Closed

Error if labels are not used is unclear #2

ccchwang opened this issue May 6, 2019 · 4 comments

Comments

@ccchwang
Copy link

ccchwang commented May 6, 2019

I'm trying to use this library in Safari and running into this error: undefined is not an object (evaluating 'l(e).textContent'). Points me to index.js:29 which says:

Screen Shot 2019-05-06 at 6 25 21 PM

Any thoughts? I've added the package through CDN and imported it into my JS. Would appreciate any help!

@Dan503
Copy link
Owner

Dan503 commented May 6, 2019

Sorry to hear you are getting this error. ☹

I'm not going to be able to fix this myself because I don't have a Mac.

If you are able to figure out what is going wrong then I might be able to fix it.

@ccchwang
Copy link
Author

ccchwang commented May 8, 2019

I realize it's because my inputs didn't have an associated <label>, so get_label($input).textContent was returning an error. I know it makes sense to have this from an accessibility perspective, so maybe add to the docs that you need a label?

@Dan503
Copy link
Owner

Dan503 commented May 8, 2019

Thanks for figuring out what the issue was.

I think I might both update the docs and throw a clearer error message if there is no label attached to the input.

@Dan503 Dan503 changed the title Getting error in Safari 11.0.1 Error if labels are not used is unclear May 16, 2019
Dan503 added a commit that referenced this issue May 16, 2019
Adding a clear missing label error message to make it easy to understand what is going wrong if you have not provided a label.

I've also added support for more valid input labelling options.

This fixes this issue:
#2
@Dan503
Copy link
Owner

Dan503 commented May 16, 2019

Fixed in v1.0.5

@Dan503 Dan503 closed this as completed May 16, 2019
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