You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now I only detect regular text and braces, surround them in spans and give them different colors.I am using input event to trigger re-parsing of the document, but I have one problem there. If I press keys other than braces then everything is ok, for example for text testqwer my html tree is
but as soon as I press a brace things become wonky. Pressing one brace results in firing event, my json document is parsed and then contents of <pre>'s are overwritten by blazor with new structure, but structure I see on a blazor does not correspond with resulting DOM in the browser. In short, content of editor should be:
I have debugged it for very long time and when I peek documentStructure.Tokens variable, extra brace is just not there. I was thinking it might be issue with render tree diffing algorithm so every time I generate new guids for tokens ids, but it changed nothing.
Can someone help me with this? My repo contains two projects, one RCL with the editor component, and another one with server-side blazor app that hosts it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am working on json editor component in a blazor: https://github.com/FLAMESpl/oaklab-blazor-components-jsoneditor/tree/repeating-brace-bug
I have a razor class https://github.com/FLAMESpl/oaklab-blazor-components-jsoneditor/blob/repeating-brace-bug/src/OakLab.Blazor.Components.JsonEditor/JsonEditor.razor with content-editable pre element where I want to put my rich text.
For now I only detect regular text and braces, surround them in spans and give them different colors.I am using input event to trigger re-parsing of the document, but I have one problem there. If I press keys other than braces then everything is ok, for example for text
testqwer
my html tree isbut as soon as I press a brace things become wonky. Pressing one brace results in firing event, my json document is parsed and then contents of
<pre>
's are overwritten by blazor with new structure, but structure I see on a blazor does not correspond with resulting DOM in the browser. In short, content of editor should be:but instead is
(note duplicated brace in first span)
I have debugged it for very long time and when I peek
documentStructure.Tokens
variable, extra brace is just not there. I was thinking it might be issue with render tree diffing algorithm so every time I generate new guids for tokens ids, but it changed nothing.Can someone help me with this? My repo contains two projects, one RCL with the editor component, and another one with server-side blazor app that hosts it.
Beta Was this translation helpful? Give feedback.
All reactions