Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

Commit

Permalink
Add markup for better JAWS and NVDA screenreader performance (basecam…
Browse files Browse the repository at this point in the history
  • Loading branch information
bergatron authored and javan committed May 9, 2018
1 parent 3196beb commit 38bb5a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/trix/elements/trix_editor_element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Trix.registerElement "trix-editor", do ->
element.setAttribute("contenteditable", "")
handleEventOnce("focus", onElement: element, withCallback: -> configureContentEditable(element))

addAccessibilityRole = (element) ->
return if element.hasAttribute("role")
element.setAttribute("role", "textbox")

configureContentEditable = (element) ->
disableObjectResizing(element)
setDefaultParagraphSeparator(element)
Expand Down Expand Up @@ -154,6 +158,7 @@ Trix.registerElement "trix-editor", do ->

createdCallback: ->
makeEditable(this)
addAccessibilityRole(this)

attachedCallback: ->
unless @hasAttribute("data-trix-internal")
Expand Down

0 comments on commit 38bb5a9

Please sign in to comment.