Skip to content

[bug] Compile time a11y warnings on svelte-range-slider-pips #197

@trevlar

Description

@trevlar

Describe the bug

When building with Vite, there are A11y warnings.

transforming (546) ../node_modules/svelte-range-slider-pips/dist/svelte/index.jsInternalCompileWarning {
  name: 'CompileWarning',
  code: 'a11y_no_static_element_interactions',
  message: '`<span>` with a pointerdown or pointerup handler must have an ARIA role\n' +
    'https://svelte.dev/e/a11y_no_static_element_interactions',
  filename: 'node_modules/svelte-range-slider-pips/dist/svelte/components/RangePips.svelte',
  position: [ 2124, 2892 ],
  start: { line: 78, column: 4, character: 2124 },
  end: { line: 100, column: 11, character: 2892 },
  frame: '76: >\n' +
    '77:   {#if (all && first !== false) || first}\n' +
    '78:     <span\n' +
    '             ^\n' +
    '79:       class="rsPip rsPip--first"\n' +
    '80:       class:rsSelected={isSelected(min, values, precision)}'
}

Link To Reproduce

This is a compile-time error and not a runtime error.

The following repo reproduces the warning.

https://github.com/trevlar/repo-a11y-build-warnings-svelte-range-slider-pips

Versions

  • svelte: v5.42.2
  • svelte-range-slider-pips: v4.1.0

Steps to reproduce the behavior:

  1. Create a Vite + Svelte 5 project
  2. Install svelte-range-slider-pips v4.1.0
  3. Import and use the RangeSlider component with pips enabled
  4. Run vite build (or vite dev)
  5. See A11y warnings in console output

Expected behavior

No errors when building.

Screenshots

Image

Device/Environment

I am using FoundryVTT with Svelte as a UI layer.

  • OS: macOS
  • Node: node-v24.13.0
  • Vite: vite/7.1.12
  • Build tool: Vite with @sveltejs/vite-plugin-svelte

Additional context

This appears to be related to Svelte 5's stricter A11y linting. The <span> elements in RangePips.svelte have on:pointerdown/on:pointerup handlers but lack ARIA roles. A fix would involve adding appropriate roles (e.g., role="button") to the interactive span elements at lines 78, 107, and 135.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvestigatingNot quite sure if it's valid, yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions