[英]Material-UI DataGrid Column Filter doesn't work with Material-UI Dialog
所以我有以下問題:我在 React JS 中制作了一個 Material-UI DataGrid,我想在 Material-UI DialogContent 中使用它。 放入 Dialog 時,表中的所有內容都可以正常工作 - 排序、renderCells、checkboxSelection 等,除了使用默認過濾。 這是一個重建錯誤的簡單示例: https://codesandbox.io/s/relaxed-stallman-sev7x?file=/src/demo.js
單擊列名稱/選項,然后單擊“過濾器”會出現錯誤,即您無法在過濾器字段中輸入。 有誰知道解決這個問題?
提前致謝,如果問題措辭不當或重復,請先在此處發布
將 disableEnforceFocus 添加到 Dialog 組件。
<Dialog disableEnforceFocus fullWidth maxWidth="xl" open={true} onClose={this.onClose}>
<DialogTitle>Test Dialog Grid</DialogTitle>
<DialogContent>t>
<div style={{ backgroundColor: "white" }}>
<DataGrid columns={columns} rows={rows} autoHeight />;
</div>
</DialogContent>
</Dialog>
<div style={{ backgroundColor: "white" }}>
<DataGrid columns={columns} rows={rows} autoHeight />;
</div>
</div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.