Skip to content

Commit

Permalink
draftjs-plugin: Fixed type in query box and some format cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
maxott committed Oct 8, 2020
1 parent 861aabe commit d182179
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/draftjs-plugins/src/linkMenu/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type SpacyAnalysis = {
export const init = (register: PiRegister) => {
registerGET({
name: 'queryLink',
url: '/search?q=":q"',
url: '/search?q=:q',
trigger: actions(Domain).VALUE,
request: (action) => {
const a = action as LinkValueAction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import {getVisibleSelectionRect} from 'draft-js';
import { getVisibleSelectionRect } from 'draft-js';
import Popper from '@material-ui/core/Popper';
import Fade from '@material-ui/core/Fade';

Expand All @@ -23,13 +23,13 @@ export const SelectionPopper = styled(({
const prevRect = React.useRef(null);

if (selection === null && domElementID === null) {
console.log("SelectionPopper hide");
console.log('SelectionPopper hide');
return null;
}
let rect = null;
if (selection) {
if (!forceShow && selection.isCollapsed()) {
console.log("SelectionPopper hide collapsed");
console.log('SelectionPopper hide collapsed');
return null;
}

Expand All @@ -53,7 +53,7 @@ export const SelectionPopper = styled(({
}
rect = el.getBoundingClientRect();
}
//console.log('>> POPPER RECT', rect);
// console.log('>> POPPER RECT', rect);
const anchorEl = {
getBoundingClientRect: () => rect,
clientWidth: rect.width,
Expand All @@ -77,10 +77,10 @@ export const SelectionPopper = styled(({

return (
<div>
<Popper
id={id}
open={true}
anchorEl={anchorEl}
<Popper
id={id}
open
anchorEl={anchorEl}
placement={placement}
disablePortal={false}
modifiers={modifiers}
Expand All @@ -90,7 +90,7 @@ export const SelectionPopper = styled(({
{({ TransitionProps }) => (
<Fade {...TransitionProps} timeout={fadeInTime}>
<>
<span className={classes.arrow} ref={setArrowRef} />
<span className={classes.arrow} ref={setArrowRef} />
{ children }
</>
</Fade>
Expand Down

0 comments on commit d182179

Please sign in to comment.