Fixed #1632 - Improve accessibility on Editable DataTable
parent
1c142f83a6
commit
81ef7ee157
|
@ -113,6 +113,11 @@ export default {
|
||||||
if (this.columnProp('frozen')) {
|
if (this.columnProp('frozen')) {
|
||||||
this.updateStickyPosition();
|
this.updateStickyPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.d_editing && (this.editMode === 'cell' || (this.editMode === 'row' && this.columnProp('rowEditor')))) {
|
||||||
|
const focusableEl = DomHandler.getFirstFocusableElement(this.$el);
|
||||||
|
focusableEl && focusableEl.focus();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
if (this.overlayEventListener) {
|
if (this.overlayEventListener) {
|
||||||
|
|
|
@ -470,6 +470,11 @@ export default {
|
||||||
return visibleFocusableElements;
|
return visibleFocusableElements;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFirstFocusableElement(element) {
|
||||||
|
const focusableElements = this.getFocusableElements(element);
|
||||||
|
return focusableElements.length > 0 ? focusableElements[0] : null;
|
||||||
|
},
|
||||||
|
|
||||||
isClickable(element) {
|
isClickable(element) {
|
||||||
const targetNode = element.nodeName;
|
const targetNode = element.nodeName;
|
||||||
const parentNode = element.parentElement && element.parentElement.nodeName;
|
const parentNode = element.parentElement && element.parentElement.nodeName;
|
||||||
|
|
|
@ -43,6 +43,7 @@ export declare class DomHandler {
|
||||||
static isVisible(el: HTMLElement): boolean;
|
static isVisible(el: HTMLElement): boolean;
|
||||||
static invokeElementMethod(el: HTMLElement, methodName: string, args: any): void;
|
static invokeElementMethod(el: HTMLElement, methodName: string, args: any): void;
|
||||||
static getFocusableElements(el: HTMLElement): any[];
|
static getFocusableElements(el: HTMLElement): any[];
|
||||||
|
static getFirstFocusableElement(el: HTMLElement): any;
|
||||||
static isClickable(el: HTMLElement): boolean;
|
static isClickable(el: HTMLElement): boolean;
|
||||||
static applyStyle(el: HTMLElement, style: any): void;
|
static applyStyle(el: HTMLElement, style: any): void;
|
||||||
static isIOS(): boolean;
|
static isIOS(): boolean;
|
||||||
|
|
Loading…
Reference in New Issue