# Accessibility - Component::isAccessible()

**URL:** <https://forum.juce.com/t/accessibility-component-isaccessible/49855>\
**Category:** General JUCE discussion\
**Created:** [January 26, 2022, 9:13am UTC](https://forum.juce.com/t/accessibility-component-isaccessible/49855 "2022-01-26T09:13:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peteatjuce](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/peteatjuce/32/2347_2.png) [@peteatjuce](https://forum.juce.com/u/peteatjuce)\
**Post date:** [January 26, 2022, 9:13am UTC](https://forum.juce.com/t/accessibility-component-isaccessible/49855/1 "2022-01-26T09:13:30Z")

</div>

Hi folks,

Just to note that I’ve realised our accessibility support had stopped working a while back.

This was down to the change if implementation of Component::isAcccessible in the following commit:

```auto
Accessibility: Disable accessibility of child components when calling `Component::setAccessible (false);`
Author:
ed <eddavies95@gmail.com>
Date:
1 September 2021 at 15:21:38 BST
Commit Date:
2 September 2021 at 08:35:14 BST

```

We have (for example) a toolbar background that isn’t accessible, but have a button on top of that that _is_ accessible. The change to isAccessible stopped prevented the button from being accessible.

The solution for me, was to change the implementation of isAccessible

```auto
bool Component::isAccessible() const noexcept
{
  return (! flags.accessibilityIgnoredFlag);
  // return (! flags.accessibilityIgnoredFlag
  // && (parentComponent == nullptr || parentComponent->isAccessible()));
}

```

So: I have (say) a toolbar background that I don’t want to be accessible, but want a button on top of that that _is_ accessible, how can I achieve that without my above change?

I’m hope some bright spark out there will explain what I’m doing wrong! 🙂

Best wishes,

Pete

---

<div class="post-metadata">

**Author:** ![ImJimmi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/imjimmi/32/10843_2.png) [@ImJimmi](https://forum.juce.com/u/ImJimmi)\
**Post date:** [January 26, 2022, 9:35am UTC](https://forum.juce.com/t/accessibility-component-isaccessible/49855/2 "2022-01-26T09:35:12Z")

</div>

The proper solution for this is to set the parent’s accessibility role to `ignored`. There’s a nice little utility function to do that:

```cpp
    std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override
    {
        return createIgnoredAccessibilityHandler (*this);
    }

```

---

<div class="post-metadata">

**Author:** ![peteatjuce](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/peteatjuce/32/2347_2.png) [@peteatjuce](https://forum.juce.com/u/peteatjuce)\
**Post date:** [January 26, 2022, 10:51am UTC](https://forum.juce.com/t/accessibility-component-isaccessible/49855/3 "2022-01-26T10:51:40Z")

</div>

Thank you very much!!

Pete
