Skip to content

Should some files provide an alt? #215

Description

@cookiecrook

Web Share API images have optional title, but seem to be missing alt.

shareButton.addEventListener("click", async () => {
  const file = new File(data, "some.png", { type: "image/png" });
  try {
    await navigator.share({
      title: "Example File",
      files: [file],
      alt: "Marcos??? 🧐"  // accessible text alternative for the image, equivalent to HTML alt attr
    });
  } catch (err) {
    console.error("Share failed:", err.message);
  }
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TPAC2025Topics for discussion at TPAC 2025

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions