Skip to content

Commit

Permalink
fix: [Stateful: Home page] Wrong announcement of code editor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Oct 11, 2024
1 parent e4dec39 commit 97e0a5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
13 changes: 10 additions & 3 deletions packages/shared-ux/code_editor/impl/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,12 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({
role="button"
onClick={startEditing}
onKeyDown={onKeyDownHint}
aria-label={ariaLabel}
aria-label={i18n.translate('sharedUXPackages.codeEditor.codeEditorEditButton', {
defaultMessage: '{codeEditorAriaLabel}, activate edit mode',
values: {
codeEditorAriaLabel: ariaLabel,
},
})}
data-test-subj={`codeEditorHint codeEditorHint--${isHintActive ? 'active' : 'inactive'}`}
/>
</EuiToolTip>
Expand Down Expand Up @@ -528,6 +533,7 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({
</div>
) : null}
<UseBug177756ReBroadcastMouseDown>
{accessibilityOverlayEnabled && renderPrompt()}
<MonacoEditor
theme={theme}
language={languageId}
Expand Down Expand Up @@ -576,6 +582,7 @@ export const CodeEditor: React.FC<CodeEditorProps> = ({

const useFullScreen = ({ allowFullScreen }: { allowFullScreen?: boolean }) => {
const [isFullScreen, setIsFullScreen] = useState(false);
const { euiTheme } = useEuiTheme();

const toggleFullScreen = () => {
setIsFullScreen(!isFullScreen);
Expand Down Expand Up @@ -617,12 +624,12 @@ const useFullScreen = ({ allowFullScreen }: { allowFullScreen?: boolean }) => {
return (
<EuiOverlayMask>
<EuiFocusTrap clickOutsideDisables={true}>
<div css={styles.fullscreenContainer}>{children}</div>
<div css={styles.fullscreenContainer(euiTheme)}>{children}</div>
</EuiFocusTrap>
</EuiOverlayMask>
);
},
[isFullScreen]
[isFullScreen, euiTheme]
);

return {
Expand Down
3 changes: 2 additions & 1 deletion packages/shared-ux/code_editor/impl/editor.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ export const styles = {
position: relative;
height: 100%;
`,
fullscreenContainer: css`
fullscreenContainer: (euiTheme: EuiThemeComputed) => css`
position: absolute;
left: 0;
top: 0;
background: ${euiTheme.colors.body};
`,
keyboardHint: (euiTheme: EuiThemeComputed) => css`
position: absolute;
Expand Down

0 comments on commit 97e0a5c

Please sign in to comment.