谁能告诉我如何处理这个问题?我对此很陌生。
function tableElements(handleViewButton: {
(rowData: Schedules): () => void;
(arg0: SchedulesRow): React.MouseEventHandler<HTMLSpanElement> | undefined;
}) {
const edit = {
title: '',
render: function Render(rowData: SchedulesRow) {
const getRef = (element: HTMLButtonElement) =>
editButtonsRef.current.splice(findButtonIndex(rowData.scheduleIdentifier, dataTable as any), 1, element);
return (
<div style={{
display: 'block', width: 80, paddingLeft: 5, paddingRight: 5
}}>
<Whisper
trigger="click"
placement='bottom'
speaker={
<Popover>
<div className="button-wrapper">
<button
className={`icon-wrapper ${styles.editButton}`}
aria-label={`Button1 ${rowData.scheduleIdentifier}`}
onClick={() => handleViewButton(rowData)}
ref={getRef}
disabled={!schedulePermissions.edit?true:false}
tabIndex={0}
>
<i className="fa fa-pencil pointer" aria-hidden/><span> Button1</span>
</button>
</div>
<div className="button-wrapper">
<button
className={`icon-wrapper ${styles.editButton}`}
aria-label={`Button2 ${rowData.scheduleIdentifier}`}
onClick={() => {handleDeleteButton(rowData)}}
ref={getRef}
disabled={!schedulePermissions.delete?true:false}
tabIndex={0}
>
<i className="fa fa-trash-o" aria-hidden/><span> Button2</span>
</button>
</div>
</Popover>
}
>
<Button appearance="subtle" className="gear-wrapper" tabIndex={0}>
<i className="fa fa-gear"></i>
</Button>
</Whisper>
</div>
);
},
};
Popover 目前不支持焦点捕获。