securingsincity / react-ace

React Ace Component
http://securingsincity.github.io/react-ace/
MIT License
4.01k stars 603 forks source link

SplitEditor not showing annotations #1911

Closed jameso-tx closed 2 months ago

jameso-tx commented 2 months ago

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});
                    }}
                />

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 commented 2 months ago

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.