aizome-kit: text fields without placeholders have no accessible name

Open
#435 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
50/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
accessibility

Research direction

Start in desktop/aizome/crates/aizome-kit/src/widgets/text_field.rs at FieldWidget::semantics(), where the label is currently derived only from the placeholder. Read the surrounding widget semantics conventions and any existing accessibility/label APIs before choosing between an explicit .label() method and a visible-label association API. Done means a field without a placeholder can expose a meaningful accessible name while keeping password/search roles and existing callers compatible, with a test covering labeled and placeholder-only fields.

Written by the indexing model from the issue text.

Description

Summary

Text fields created without a placeholder do not expose an accessible name through their semantic representation.

In desktop/aizome/crates/aizome-kit/src/widgets/text_field.rs, the FieldWidget::semantics() implementation derives the semantic label exclusively from the field's placeholder:

label: self.placeholder.as_deref().map(str::to_owned),

When a text field has no placeholder, its semantic label becomes None.

This may cause difficulties for users relying on screen readers and other assistive technologies, as the input field may not have a meaningful accessible name.
Affected Component

  • Component: aizome-kit
  • File: desktop/aizome/crates/aizome-kit/src/widgets/text_field.rs
  • Method: FieldWidget::semantics()

Steps to Reproduce

  1. Create a text field without specifying a placeholder.
  2. Give the field a visible descriptive label elsewhere in the interface.
  3. Inspect the field's semantic representation.
  4. Observe that its semantic label is None.

For example:

let name_field = k::text_field(&self.name)
    .on_change(Msg::Name);

The field has no placeholder, and its semantic representation does not provide an accessible label.

Expected Behavior

Text fields should expose a meaningful accessible name independently of whether a placeholder has been specified.

A visible form label should ideally be associated with its corresponding input field so that assistive technologies can identify the purpose of the field.

Actual Behavior

The semantic label is populated exclusively from the placeholder:

label: self.placeholder.as_deref().map(str::to_owned),

Consequently, when a text field is created without a placeholder, its semantic label is None.

Why This Matters

Accessible names are important for users relying on screen readers and other assistive technologies.

Without meaningful labels:

  • Users may have difficulty identifying the purpose of individual input fields.
  • Forms containing multiple similar text fields can become confusing.
  • Applications built with aizome-kit may provide visually understandable forms that are less accessible to assistive technology users.

Suggested Solution

Consider introducing an explicit accessible-label API for TextField, independently of its placeholder.

For example:

let name_field = k::text_field(&self.name)
    .placeholder("Enter your name")
    .label("Name")
    .on_change(Msg::Name);

The semantic representation could then use the explicitly provided label, falling back to the placeholder only when appropriate.

Alternatively, consider providing an accessibility API that allows applications to associate an existing visible label with its corresponding input field.

Additional Considerations

  • Placeholder text should not be the only mechanism for providing an accessible name.
  • Existing applications should remain compatible with the current API.
  • Password and search fields should retain their existing semantic roles.
  • The implementation should follow the accessibility conventions already used by the project's widget system.
Dominant language
Rust
Stars
38
Forks
3
Avg merge
1d 8h
Merged PRs (30d)
103

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bitemyapp/sekka

All issues in bitemyapp/sekka

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.