我正在将输入框添加到Microsoft Fabric DeatialsList中的列。我在IColumn定义的onRender中进行设置。除tabIndex始终为-1之外,其他所有方法均正常运行。我想将其设置为0。
export default class Scrach extends React.Component<IScrachProps, {}> {
private testData:{}[]=[{Item:1},
{Item:1},
{Item:1}];
private testCols: IColumn[] = [
{key:"col1",
name:"Items",
fieldName:"Item",
onRender:(item)=>{return(<input style={{width:'3em'}}
tabIndex={0}
type="text"
defaultValue="1"
onClick={this.selectText}/>);},
minWidth:60,
isResizable:false
}];
public render(): React.ReactElement<IScrachProps> {
return (
<div>
<DetailsList
items={this.testData}
columns={this.testCols}
setKey="set"
layoutMode={DetailsListLayoutMode.fixedColumns}
selectionPreservedOnEmptyClick={true}
selectionMode={SelectionMode.none}
/>
</div>
);
}
}
有什么想法吗?