Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix Paragraphs
  • Loading branch information
Gondragos committed Oct 11, 2023
commit a08ca1ceef786158db857edad2895a62af965853
2 changes: 1 addition & 1 deletion src/mixins/SpanText.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default types
// skip it to allow another span to be selected
if (self.parent._currentSpan !== this) {
ev.stopPropagation();
self.parent._currentSpan = this;
self.parent.setCurrentSpan(this);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/tags/object/Paragraphs/HtxParagraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class HtxParagraphsView extends Component {
return;
}

item._currentSpan = null;
item.setCurrentSpan(null);

if (isFF(FF_DEV_2918)) {
const htxRanges = item.addRegions(selectedRanges);
Expand Down
5 changes: 5 additions & 0 deletions src/tags/object/Paragraphs/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ const Model = types

return !self.filterByAuthor.length || self.filterByAuthor.includes(data[self.namekey]);
},
}))
.actions(self => ({
setCurrentSpan(currentSpan) {
self._currentSpan = currentSpan;
},
}));

const PlayableAndSyncable = types.model()
Expand Down