Skip to content

Instantly share code, notes, and snippets.

@gustav1105
Created February 17, 2020 04:31
Show Gist options
  • Save gustav1105/e24e8f1bc1246808522fbeba945a0e5a to your computer and use it in GitHub Desktop.
Save gustav1105/e24e8f1bc1246808522fbeba945a0e5a to your computer and use it in GitHub Desktop.
draft-utils-plugin
<TextField
variant="outlined"
InputProps={{
endAdornment: (
<InputAdornment position="start">
<IconButton
onClick={() => {
setEditorState(
draftUtils.createLinkAtSelection(editorState, anchorElUrl)
);
setToggleButtonGroupValue(null);
}}
>
<Check />
</IconButton>
</InputAdornment>
)
}}
placeholder="https://"
value={anchorElUrl}
onChange={e => setAnchorElUrl(e.target.value)}
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment