MDL-43267 Javascript: Remove aria drag/drop related attributes for drag/drop
Since we provide an alternative interface rather than describing the locations for each drop, we should not add aria-grabbed, or aria-dropeffect.
This commit is contained in:
@@ -166,8 +166,7 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
.setAttribute('title', title)
|
||||
.setAttribute('tabIndex', 0)
|
||||
.setAttribute('data-draggroups', this.groups)
|
||||
.setAttribute('role', 'button')
|
||||
.setAttribute('aria-grabbed', 'false');
|
||||
.setAttribute('role', 'button');
|
||||
dragelement.appendChild(dragicon);
|
||||
dragelement.addClass(MOVEICON.cssclass);
|
||||
|
||||
@@ -370,8 +369,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
M.core.dragdrop.keydragcontainer = dragcontainer;
|
||||
M.core.dragdrop.keydraghandle = draghandle;
|
||||
|
||||
// Indicate to a screenreader the node that is selected for drag and drop.
|
||||
dragcontainer.setAttribute('aria-grabbed', 'true');
|
||||
// Get the name of the thing to move.
|
||||
var nodetitle = this.find_element_text(dragcontainer);
|
||||
var dialogtitle = M.util.get_string('movecontent', 'moodle', nodetitle);
|
||||
@@ -426,8 +423,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
|
||||
// Add a data attribute so we can get the real drop target.
|
||||
listlink.setAttribute('data-drop-target', node.get('id'));
|
||||
// Notify the screen reader this is a valid drop target.
|
||||
listlink.setAttribute('aria-dropeffect', 'move');
|
||||
// Allow tabbing to the link.
|
||||
listlink.setAttribute('tabindex', '0');
|
||||
|
||||
@@ -517,7 +512,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
global_keyboard_drop: function(e) {
|
||||
// The drag node was saved.
|
||||
var dragcontainer = M.core.dragdrop.keydragcontainer;
|
||||
dragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
// The real drop node is stored in an attribute of the proxy.
|
||||
var droptarget = Y.one('#' + e.target.getAttribute('data-drop-target'));
|
||||
|
||||
@@ -542,7 +536,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
*/
|
||||
global_cancel_keyboard_drag: function() {
|
||||
if (M.core.dragdrop.keydragcontainer) {
|
||||
M.core.dragdrop.keydragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
M.core.dragdrop.keydraghandle.focus();
|
||||
M.core.dragdrop.keydragcontainer = null;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -166,8 +166,7 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
.setAttribute('title', title)
|
||||
.setAttribute('tabIndex', 0)
|
||||
.setAttribute('data-draggroups', this.groups)
|
||||
.setAttribute('role', 'button')
|
||||
.setAttribute('aria-grabbed', 'false');
|
||||
.setAttribute('role', 'button');
|
||||
dragelement.appendChild(dragicon);
|
||||
dragelement.addClass(MOVEICON.cssclass);
|
||||
|
||||
@@ -370,8 +369,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
M.core.dragdrop.keydragcontainer = dragcontainer;
|
||||
M.core.dragdrop.keydraghandle = draghandle;
|
||||
|
||||
// Indicate to a screenreader the node that is selected for drag and drop.
|
||||
dragcontainer.setAttribute('aria-grabbed', 'true');
|
||||
// Get the name of the thing to move.
|
||||
var nodetitle = this.find_element_text(dragcontainer);
|
||||
var dialogtitle = M.util.get_string('movecontent', 'moodle', nodetitle);
|
||||
@@ -426,8 +423,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
|
||||
// Add a data attribute so we can get the real drop target.
|
||||
listlink.setAttribute('data-drop-target', node.get('id'));
|
||||
// Notify the screen reader this is a valid drop target.
|
||||
listlink.setAttribute('aria-dropeffect', 'move');
|
||||
// Allow tabbing to the link.
|
||||
listlink.setAttribute('tabindex', '0');
|
||||
|
||||
@@ -517,7 +512,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
global_keyboard_drop: function(e) {
|
||||
// The drag node was saved.
|
||||
var dragcontainer = M.core.dragdrop.keydragcontainer;
|
||||
dragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
// The real drop node is stored in an attribute of the proxy.
|
||||
var droptarget = Y.one('#' + e.target.getAttribute('data-drop-target'));
|
||||
|
||||
@@ -542,7 +536,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
*/
|
||||
global_cancel_keyboard_drag: function() {
|
||||
if (M.core.dragdrop.keydragcontainer) {
|
||||
M.core.dragdrop.keydragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
M.core.dragdrop.keydraghandle.focus();
|
||||
M.core.dragdrop.keydragcontainer = null;
|
||||
}
|
||||
|
||||
Vendored
+1
-8
@@ -164,8 +164,7 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
.setAttribute('title', title)
|
||||
.setAttribute('tabIndex', 0)
|
||||
.setAttribute('data-draggroups', this.groups)
|
||||
.setAttribute('role', 'button')
|
||||
.setAttribute('aria-grabbed', 'false');
|
||||
.setAttribute('role', 'button');
|
||||
dragelement.appendChild(dragicon);
|
||||
dragelement.addClass(MOVEICON.cssclass);
|
||||
|
||||
@@ -368,8 +367,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
M.core.dragdrop.keydragcontainer = dragcontainer;
|
||||
M.core.dragdrop.keydraghandle = draghandle;
|
||||
|
||||
// Indicate to a screenreader the node that is selected for drag and drop.
|
||||
dragcontainer.setAttribute('aria-grabbed', 'true');
|
||||
// Get the name of the thing to move.
|
||||
var nodetitle = this.find_element_text(dragcontainer);
|
||||
var dialogtitle = M.util.get_string('movecontent', 'moodle', nodetitle);
|
||||
@@ -424,8 +421,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
|
||||
// Add a data attribute so we can get the real drop target.
|
||||
listlink.setAttribute('data-drop-target', node.get('id'));
|
||||
// Notify the screen reader this is a valid drop target.
|
||||
listlink.setAttribute('aria-dropeffect', 'move');
|
||||
// Allow tabbing to the link.
|
||||
listlink.setAttribute('tabindex', '0');
|
||||
|
||||
@@ -515,7 +510,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
global_keyboard_drop: function(e) {
|
||||
// The drag node was saved.
|
||||
var dragcontainer = M.core.dragdrop.keydragcontainer;
|
||||
dragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
// The real drop node is stored in an attribute of the proxy.
|
||||
var droptarget = Y.one('#' + e.target.getAttribute('data-drop-target'));
|
||||
|
||||
@@ -540,7 +534,6 @@ Y.extend(DRAGDROP, Y.Base, {
|
||||
*/
|
||||
global_cancel_keyboard_drag: function() {
|
||||
if (M.core.dragdrop.keydragcontainer) {
|
||||
M.core.dragdrop.keydragcontainer.setAttribute('aria-grabbed', 'false');
|
||||
M.core.dragdrop.keydraghandle.focus();
|
||||
M.core.dragdrop.keydragcontainer = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user