Logs: cleaned up warnings because of duplicate keys in context menu
Summary: In dev build there were tons of warnings on opening table context menu, because some items had same keys. This diff fixes that by differentiating item keys. Reviewed By: mweststrate Differential Revision: D33277520 fbshipit-source-id: aca2fa2f1163a2b6782be0ca4c5baebdecc5acd5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dd4d7bbe7f
commit
d48fbd8e50
@@ -111,7 +111,7 @@ export function tableContextMenuFactory<T>(
|
|||||||
</Item>
|
</Item>
|
||||||
{lib.isFB && (
|
{lib.isFB && (
|
||||||
<Item
|
<Item
|
||||||
key="createPaste"
|
key="createPasteJSON"
|
||||||
disabled={!hasSelection}
|
disabled={!hasSelection}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const items = getSelectedItems(datasource, selection);
|
const items = getSelectedItems(datasource, selection);
|
||||||
@@ -131,7 +131,7 @@ export function tableContextMenuFactory<T>(
|
|||||||
disabled={!hasSelection}>
|
disabled={!hasSelection}>
|
||||||
{visibleColumns.map((column, idx) => (
|
{visibleColumns.map((column, idx) => (
|
||||||
<Item
|
<Item
|
||||||
key={column.key ?? idx}
|
key={'copy cell' + (column.key ?? idx)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const items = getSelectedItems(datasource, selection);
|
const items = getSelectedItems(datasource, selection);
|
||||||
if (items.length) {
|
if (items.length) {
|
||||||
@@ -147,7 +147,7 @@ export function tableContextMenuFactory<T>(
|
|||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
<SubMenu title="Visible columns" key="visible columns">
|
<SubMenu title="Visible columns" key="visible columns">
|
||||||
{columns.map((column, idx) => (
|
{columns.map((column, idx) => (
|
||||||
<Menu.Item key={column.key ?? idx}>
|
<Menu.Item key={'visible column ' + (column.key ?? idx)}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={column.visible}
|
checked={column.visible}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user