亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

MUIdatatables 如何使用箭頭/tab 鍵導航?

MUIdatatables 如何使用箭頭/tab 鍵導航?

忽然笑 2022-07-15 10:26:30
我想使用 tabkey 導航來導航 MUIdatatable 行。請建議我任何合適的方法。我已經嘗試過基本的 taIndex,啟用 Focus 等東西,但它們似乎在這里無法正常工作。import React from "react";import ReactDOM from "react-dom";import MUIDataTable from "mui-datatables";class App extends React.Component {  render() {    const columns = ["Name", "Title", "Location", "Age", "Salary"];    const data = [      ["Gabby George", "Business Analyst", "Minneapolis", 30, "$100,000"],      ["Aiden Lloyd", "Business Consultant", "Dallas", 55, "$200,000"],      ["Jaden Collins", "Attorney", "Santa Ana", 27, "$500,000"],    ];    const options = {      filterType: "dropdown",      responsive: "scroll"    };    return (      <MUIDataTable        title={"ACME Employee list"}        data={data}        columns={columns}        options={options}        enableFocusedCell="true"      />    );  }}ReactDOM.render(<App />, document.getElementById("root"));
查看完整描述

1 回答

?
料青山看我應如是

TA貢獻1772條經驗 獲得超8個贊

MUI 數據表已經支持鍵盤導航(例如使用Tab鍵)


通過使用 tabkey navigation 導航 MUIdatatable 行,我認為您想要做的可能是將指針指向第一行?為此,您可以嘗試將指針設置為在安裝時關注第一行:


componentDidMount() {

  // Start with the first row

  document.getElementById("MUIDataTableSelectCell-0").focus();

}


查看完整回答
反對 回復 2022-07-15
  • 1 回答
  • 0 關注
  • 102 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號