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

Not accepting PayPal input image statement with an alt message. #3331

Closed
raguay opened this issue Aug 2, 2019 · 3 comments · Fixed by #3332
Closed

Not accepting PayPal input image statement with an alt message. #3331

raguay opened this issue Aug 2, 2019 · 3 comments · Fixed by #3332
Labels

Comments

@raguay
Copy link

raguay commented Aug 2, 2019

Describe the bug
I have a component that uses an input type image and it has an alt message also. But the svelte compiler is constantly warning that it needs an alt message.

Logs

(!) Plugin svelte: A11y: <input type="image"> element should have an alt, aria-label or aria-labelledby attribute
src/components/Donate.svelte
<input type="image" alt="PayPal: A safe way to make donations." src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit">

To Reproduce
Have a component with the the html for a PayPal donate button. It will always generate the error when you compile. But, since it's a warning, I still get the processed files okay.

  • If you can demonstrate the bug using https://svelte.dev/repl, please do.
  • If that's not possible, we recommend creating a small repo that illustrates the problem.
  • Reproductions should be small, self-contained, correct examples – http://sscce.org.

Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.

Expected behavior
It should compile without errors since the input image element has an alt message.

Information about your Svelte project:

  • Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)
    NW.js version 40
  • Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)
    Macos Mogave
  • Svelte version (Please check you can reproduce the issue with the latest release!)
    3.6.8
  • Whether your project uses Webpack or Rollup
    Rollup 1.17
    Severity
    How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely?

It's just very annoying. I hate to have error messages/warnings.
Note: the more honest and specific you are here the more we will take you seriously.

Additional context
Add any other context about the problem here.

@Conduitry Conduitry added the bug label Aug 2, 2019
@Conduitry
Copy link
Member

This is reproducible in the REPL.

<input type="image" alt="PayPal: A safe way to make donations." src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit">

Svelte returns an incorrect warning about this element needing alt, aria-label, or aria-labelledby.

@Conduitry
Copy link
Member

if (type && type.get_static_value() === 'image') {

We're not actually checking whether one of the expected attributes is present before calling the function that emits the warning.

Conduitry added a commit to Conduitry/sveltejs_svelte that referenced this issue Aug 2, 2019
Rich-Harris added a commit that referenced this issue Aug 3, 2019
fix erroneous a11y warning with input type='image'
@Conduitry
Copy link
Member

This is fixed in 3.6.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants