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

Initialize EuiCodeEditor with existing mode #2616

Merged
merged 5 commits into from
Dec 11, 2019

Conversation

thompsongl
Copy link
Contributor

@thompsongl thompsongl commented Dec 9, 2019

Summary

Work in #2577 happened upon a 404 error related custom modes in EuiCodeEditor (and prevents its docs from building statically). When setting a custom mode, EuiCodeEditor would initialize without a mode and use setMode on componentDidMount, resulting in an attempt to fetch [some_path]/mode-mode.js, which does not exist (error visible in prod docs, also).

The react-ace docs specify that the component should be initialized with an existing mode prior to setting the custom mode. This prevents the fetch of a nonexistent mode file.

Fixes #2524

Checklist

- [ ] Checked in dark mode
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation examples
- [ ] Added or updated jest tests

  • Checked for breaking changes and labeled appropriately

- [ ] Checked for accessibility including keyboard-only and screenreader modes

  • A changelog entry exists and is marked appropriately

Copy link
Contributor Author

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note that this will also close #2524

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM; Pulled and tested locally. One small ask.

Nice, clean fix for an interesting ACE issue!

src/components/code_editor/code_editor.js Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

[EuiCodeEditor] Custom Modes
2 participants