-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/toc without transaction #5893
Conversation
443d9f3
to
53ae9d7
Compare
this.$editor | ||
.chain() | ||
.focus() | ||
.setTextSelection(heading.position) | ||
.scrollIntoView() | ||
.run() | ||
document.getElementById(heading.id).scrollIntoView() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly different from what we used to do. In particular we do not set the cursor anymore.
We could also use the old way replacing heading.position
with heading.offset + 1
. I changed it as relying on the id seemed more robust to me than the offset at that time - but both should be fine now as we recompute and update the offset whenever the doc changes.
Very nice, unfortunately this does not seem to fix the initial update step stent for read only sessions. |
Additional backend attempt at #5895 |
Yes... that's exactly what I wondered this morning - whether the toc transaction was really the cause. Thanks for coming up with the backend fix. I'll take a look at it. |
Since this does not fix the 403s fully, there's no rush to get it into todays RC anymore. I'll fix the tests and see if it fixes nextcloud/collectives#1114 . |
e78caba
to
6015463
Compare
This comment was marked as resolved.
This comment was marked as resolved.
I figured it out. By default decorations are put behind the cursor in the given position. Adding a |
f3a233d
to
da1b008
Compare
8d3502e
to
0594780
Compare
0594780
to
81bae7b
Compare
Signed-off-by: Max <max@nextcloud.com>
This avoids transactions that actually change the document state. Fixes #5861. Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
This will trigger an update event on the editor which in turn will trigger all update handlers. Avoid this when not necessary. Signed-off-by: Max <max@nextcloud.com>
This allows typing even at the beginning of the heading as the cursor now is between the anchor and the first letter. Signed-off-by: Max <max@nextcloud.com>
The toc does not trigger a transaction anymore and therefore there is no push to wait for either. Also use cypress aliases and avoid deep nesting of cypress calls when possible. Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
81bae7b
to
ea2e93d
Compare
/backport to stable29 |
/backport to stable28 |
When the whole document gets replaced by the same content, `DecorationSet.map()` returns an empty decorationSet. So only use it for updates where no decorations get removed. Signed-off-by: Jonas <jonas@freesources.org>
ea2e93d
to
e0d10b2
Compare
📝 Summary
🚧 TODO
🏁 Checklist
npm run lint
/npm run stylelint
/composer run cs:check
)