Skip to content
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

Undefined pages when pasting text #3718

Open
5e-Cleric opened this issue Sep 9, 2024 · 1 comment · Fixed by #3891
Open

Undefined pages when pasting text #3718

5e-Cleric opened this issue Sep 9, 2024 · 1 comment · Fixed by #3891
Labels
bug We say this works but it doesn't complicated needs more info P3 - low priority Obscure tweak or fix for a single user

Comments

@5e-Cleric
Copy link
Member

5e-Cleric commented Sep 9, 2024

Tested in

Operating System Browser Renderer
Windows Chrome 128 v3

Description of the issue

When pasting text in a brew with multiple pages, the DOM seems to update incorrectly, leaving unreferenced pages in the preview. See attached file:

Grabacion.2024-09-08.104936.mp4
@5e-Cleric 5e-Cleric added bug We say this works but it doesn't complicated needs more info P3 - low priority Obscure tweak or fix for a single user labels Sep 9, 2024
@calculuschild
Copy link
Member

For posterity, the issue was caused by the page at the current cursor position being given first priority when rendering pages. This is desired in most cases, since it allows cross-page content (variables, links) to update first before re-rendering other pages. This breaks if we suddenly reduce the number of pages with the editor cursor on the last page:

  1. CTRL+A places the cursor at the last page
  2. pasting over the editor with fewer pages means the last known "cursor page" is greater than the actual page count.
  3. BrewRenderer attempts to render the last known "cursor page", which is empty, resulting in an "unknown" content page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We say this works but it doesn't complicated needs more info P3 - low priority Obscure tweak or fix for a single user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants