Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax-prosemirror
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wax
wax-prosemirror
Commits
0d55624f
Commit
0d55624f
authored
4 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
remove selection if focus is lost from note
parent
aba2ee8b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!258
Editoria fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wax-prosemirror-components/src/components/comments/ConnectedComment.js
+2
-1
2 additions, 1 deletion
...or-components/src/components/comments/ConnectedComment.js
wax-prosemirror-services/src/NoteService/Editor.js
+9
-1
9 additions, 1 deletion
wax-prosemirror-services/src/NoteService/Editor.js
with
11 additions
and
2 deletions
wax-prosemirror-components/src/components/comments/ConnectedComment.js
+
2
−
1
View file @
0d55624f
...
@@ -50,7 +50,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
...
@@ -50,7 +50,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
const
commentPlugin
=
app
.
PmPlugins
.
get
(
'
commentPlugin
'
);
const
commentPlugin
=
app
.
PmPlugins
.
get
(
'
commentPlugin
'
);
const
activeComment
=
commentPlugin
.
getState
(
activeView
.
state
).
comment
;
const
activeComment
=
commentPlugin
.
getState
(
activeView
.
state
).
comment
;
console
.
log
(
activeComment
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setIsActive
(
false
);
setIsActive
(
false
);
recalculateTops
();
recalculateTops
();
...
@@ -121,6 +121,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
...
@@ -121,6 +121,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
});
});
// if (allCommentsWithSameId.length > 1);
// if (allCommentsWithSameId.length > 1);
// maxPos += last(allCommentsWithSameId).node.nodeSize;
// maxPos += last(allCommentsWithSameId).node.nodeSize;
recalculateTops
();
dispatch
(
state
.
tr
.
removeMark
(
minPos
,
maxPos
,
commentMark
));
dispatch
(
state
.
tr
.
removeMark
(
minPos
,
maxPos
,
commentMark
));
activeView
.
focus
();
activeView
.
focus
();
};
};
...
...
This diff is collapsed.
Click to expand it.
wax-prosemirror-services/src/NoteService/Editor.js
+
9
−
1
View file @
0d55624f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
React
,
{
useEffect
,
useRef
,
useContext
,
useMemo
}
from
'
react
'
;
import
React
,
{
useEffect
,
useRef
,
useContext
,
useMemo
}
from
'
react
'
;
import
{
filter
}
from
'
lodash
'
;
import
{
filter
}
from
'
lodash
'
;
import
{
EditorView
}
from
'
prosemirror-view
'
;
import
{
EditorView
}
from
'
prosemirror-view
'
;
import
{
EditorState
}
from
'
prosemirror-state
'
;
import
{
EditorState
,
TextSelection
}
from
'
prosemirror-state
'
;
import
{
StepMap
}
from
'
prosemirror-transform
'
;
import
{
StepMap
}
from
'
prosemirror-transform
'
;
import
{
baseKeymap
}
from
'
prosemirror-commands
'
;
import
{
baseKeymap
}
from
'
prosemirror-commands
'
;
import
{
keymap
}
from
'
prosemirror-keymap
'
;
import
{
keymap
}
from
'
prosemirror-keymap
'
;
...
@@ -37,6 +37,14 @@ export default ({ node, view }) => {
...
@@ -37,6 +37,14 @@ export default ({ node, view }) => {
// This is the magic part
// This is the magic part
dispatchTransaction
,
dispatchTransaction
,
handleDOMEvents
:
{
handleDOMEvents
:
{
blur
:
()
=>
{
context
.
view
[
noteId
].
dispatch
(
context
.
view
[
noteId
].
state
.
tr
.
setSelection
(
new
TextSelection
(
context
.
view
[
noteId
].
state
.
tr
.
doc
.
resolve
(
0
)),
),
);
},
mousedown
:
()
=>
{
mousedown
:
()
=>
{
context
.
updateView
({},
noteId
);
context
.
updateView
({},
noteId
);
clickInNote
=
true
;
clickInNote
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment