move the enter session editable to a custom component
parent
7ba85921b1
commit
7c726c8f47
@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
placeholder: string;
|
||||||
|
editable?: boolean;
|
||||||
|
onChange?: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class SessionIdEditable extends React.PureComponent<Props> {
|
||||||
|
|
||||||
|
public render() {
|
||||||
|
const { placeholder, editable, onChange } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="session-id-editable"
|
||||||
|
placeholder={placeholder}
|
||||||
|
contentEditable={editable}
|
||||||
|
onInput={(e: any) => {
|
||||||
|
if (editable) {
|
||||||
|
onChange(e);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue