diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a4bc7170df..28797bffef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Added `utcOffset` prop to `EuiSuperDatePicker` ([#3436](https://github.com/elastic/eui/pull/3436)) - Added `partition` key to `EuiChartThemeType` for Partition chart support ([#3387](https://github.com/elastic/eui/pull/3387)) - Updated `EuiImage`'s `caption` prop type from `string` to `ReactNode` ([#3387](https://github.com/elastic/eui/pull/3387)) +- Fixed `EuiCodeEditor` console error when using the editor without import the default theme ([#3454](https://github.com/elastic/eui/pull/3454)) **Bug Fixes** diff --git a/src/components/code_editor/code_editor.tsx b/src/components/code_editor/code_editor.tsx index c7fa69d1a4d..fb3da63061e 100644 --- a/src/components/code_editor/code_editor.tsx +++ b/src/components/code_editor/code_editor.tsx @@ -26,6 +26,7 @@ import { htmlIdGenerator, keyCodes } from '../../services'; import { EuiI18n } from '../i18n'; const DEFAULT_MODE = 'text'; +const DEFAULT_THEME = 'textmate'; function setOrRemoveAttribute( element: HTMLTextAreaElement, @@ -215,7 +216,7 @@ export class EuiCodeEditor extends Component< cursorStart, mode = DEFAULT_MODE, 'data-test-subj': dataTestSubj = 'codeEditorContainer', - theme = 'github', + theme = DEFAULT_THEME, ...rest } = this.props;