Skip to content

Commit

Permalink
fix(NcRichContenteditable): add aria-placeholder
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme authored and Antreesy committed Sep 14, 2023
1 parent 9619518 commit b2540f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export default {
}"
:contenteditable="canEdit"
:placeholder="placeholder"
:aria-placeholder="placeholder"
aria-multiline="true"
class="rich-contenteditable__input"
role="textbox"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,17 @@ describe('NcRichContenteditable', () => {
expect(handlers.paste).toHaveBeenCalledTimes(1)
expect(handlers.blur).toHaveBeenCalledTimes(1)
})

it('should has accessible placeholder from placeholder prop', async () => {
const PLACEHOLDER = 'TEST_PLACEHOLDER'
const { wrapper } = mountNcRichContenteditable({
propsData: {
placeholder: PLACEHOLDER,
},
})
// Accessible placeholder
expect(wrapper.attributes('aria-placeholder')).toBe(PLACEHOLDER)
// Used in CSS for visible placeholder
expect(wrapper.attributes('placeholder')).toBe(PLACEHOLDER)
})
})

0 comments on commit b2540f3

Please sign in to comment.