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

SplitEditor not showing annotations #1911

Closed
jameso-tx opened this issue May 13, 2024 · 1 comment
Closed

SplitEditor not showing annotations #1911

jameso-tx opened this issue May 13, 2024 · 1 comment

Comments

@jameso-tx
Copy link

Problem

Annotation object not displaying in gutter for SplitEditor. However, same code will display annotation when using AceEditor. When inspecting the html for the SplitEditor, there is no tabindex: "-1" class="ace_gutter_annotation" or other associated elements to display in either text-area.

Sample code

ace-builds": {"version": "1.33.2"}
react-ace": {"version": "10.1.0"}

Thank you in advance for your time. I am not sure if this is a code thing or an actual issue. Please see the following SplitEditor configuration in the React Component.

                <SplitEditor
                    name="UNIQUE_ID_OF_DIV"
                    height="500px"
                    width="inherit"
                    mode="text"
                    theme="github"
                    splits={2}
                    orientation="beside"
                    value={this.state.editorArray ? this.state.editorArray : ["",""]}
                    annotations={[{row: 0, column: 2, type: 'error', text: 'Some error.'},{ row: 2, column: 4, type: 'error', text: 'Some other error.'}]}
                    setOptions={{ useWorker: false }}
                    onChange={(event) => {
                        this.setState({editorArray: event});
                    }}
                />
  • console output from split.js showing the session annotation is populated
    session.$annotations { "row": 2, "column": 4, "type": "error", "text": "Some other error." }

I have tried many 'tricks' before posting so as to avoid being wasteful of your time. Thank you again for any input or direction. Please let me know if more detail is needed or if I can help further.

References

Progress on: #

@jameso-tx
Copy link
Author

Update: After some messing around I was able to get the annotation to display for the SplitEditor using an array of arrays, as clearly marked in the documentation. My apologies for any bother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant