Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textarea shows both placeholder and aria-placeholder, and thats an issue #7132

Closed
alon24 opened this issue Oct 26, 2020 · 6 comments · Fixed by #7156 or #7421
Closed

Textarea shows both placeholder and aria-placeholder, and thats an issue #7132

alon24 opened this issue Oct 26, 2020 · 6 comments · Fixed by #7156 or #7421
Assignees
Labels

Comments

@alon24
Copy link

alon24 commented Oct 26, 2020

Using accessibility-checker we see that there is an issue with textarea - its adding both placeholer and aria-placeholder which is an issue.

As an aside, in my code I do not add placeholder at all

<TextArea
        id='description'
        name='description'
        {...description}
        labelText={t('addSecret.secretForm.description')}
        invalid={!!(descriptionMeta.touched && descriptionMeta.error)}
        invalidText={descriptionMeta.error}
      />

image

@dakahn
Copy link
Contributor

dakahn commented Oct 26, 2020

Confirmed this is an issue on react.carbondesign

@dakahn
Copy link
Contributor

dakahn commented Oct 26, 2020

placeholder was added in this pr #6819

@carmacleod
Copy link
Contributor

@dakahn

I think you can just use "or null" to make sure the placeholder is not used if it is not given, i.e.

      placeholder={placeholder || null}
      aria-placeholder={placeholder || null}

Do you need to support IE11? If not, then you don't need to use aria-placeholder at all, because modern browsers all map the placeholder attribute of HTML textarea to aria-placeholder automatically. (Actually, even in IE11, NVDA reads the placeholder, but JAWS doesn't.)

The only "modern" reason to use aria-placeholder would be if you decide to switch the implementation to a div contenteditable or something that doesn't support placeholder... but then you would have a bunch more work to do, so don't do that. :)

@alon24
Copy link
Author

alon24 commented Nov 29, 2020

This is not a fix, it does not fix the issue, it just hides it if its null.
The issue is that there is BOTH placeholder and aria-placeholder
So are you saying this is ok, and the tester is wrong?

@emyarod emyarod reopened this Nov 30, 2020
@alon24
Copy link
Author

alon24 commented Dec 7, 2020

any ETA on this?

@emyarod
Copy link
Member

emyarod commented Dec 7, 2020

not yet, it's being looked into

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants