Skip to content

NVDA does not read ComboBox names with complex Headers in MaterialDesignFloatingHintComboBox and MaterialDesignFilledComboBox #3904

@rezabakhshilaktasaraei

Description

@rezabakhshilaktasaraei

Bug explanation

When using ComboBox controls with MaterialDesignFloatingHintComboBox or MaterialDesignFilledComboBox styles, NVDA does not read the control's name correctly if the Header is complex (e.g., a StackPanel or DockPanel). This makes the controls inaccessible to screen reader users, as NVDA skips or fails to announce a meaningful name.
Steps to Reproduce:

  1. Use a ComboBox with MaterialDesignFloatingHintComboBox or MaterialDesignFilledComboBox style.
  2. Set a complex Header (e.g., a DockPanel with another ComboBox or a StackPanel with a TextBlock and icon).
  3. Set materialDesign:HintAssist.Hint to a descriptive string (e.g., "Routing").
  4. Run the app and navigate to the ComboBox with NVDA.
    Expected Behavior:
    NVDA should announce a meaningful name for the ComboBox, ideally using HintAssist.Hint.
    Actual Behavior:
    NVDA does not announce a meaningful name, reducing accessibility.
    Proposed Solution:
    Add a Setter to the MaterialDesignFloatingHintComboBox and MaterialDesignFilledComboBox styles in MaterialDesignTheme.ComboBox.xaml to set AutomationProperties.Name based on HintAssist.Hint:
<Style x:Key="MaterialDesignFloatingHintComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}"> </Style> <Style x:Key="MaterialDesignFilledComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}"> </Style>

Benefits:
• Enhances accessibility for screen reader users.
• Uses existing HintAssist.Hint for consistency.
• No visual changes to the ComboBox.
• Removes need for manual AutomationProperties.Name in XAML.
Code Sample:

Additional Notes:
• Currently, I must manually set AutomationProperties.Name for each ComboBox, which is repetitive.

Version

5.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions