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

fix(CodeEditor) resizeObserver resize loop #10644

Merged

Conversation

Dominik-Petrik
Copy link
Contributor

What: Closes #10087

Fix is simple enough, but I struggled to reliably reproduce the bug. Please try to reproduce it and validate the fix.

How do you reproduce the problem?

  • Run react application in webpack with dev error overlay enabled.

  • Render:

import React from 'react';
import { CodeEditor, Language } from '@patternfly/react-code-editor';
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';

export const ValuesCodeEditor = ({ code }: { code: string }) => {
  const onEditorDidMount = (editor: editor.IStandaloneCodeEditor) => {
    editor.layout();
    editor.focus();
  };

  return (
    <CodeEditor
      isLineNumbersVisible={false}
      isReadOnly
      code={code}
      language={Language.json}
      onEditorDidMount={onEditorDidMount}
      height="400px"
    />
  );
};
  • Reduce your browser's zoom level to 90%.

  • Observe the errors thrown.

@tlabaj
Copy link
Contributor

tlabaj commented Jun 24, 2024

Can you please try to rebase your PR. Katie fixed the build issue.

@tlabaj tlabaj force-pushed the code-editor-resize-observer branch 2 times, most recently from 53d672c to 68092e9 Compare July 3, 2024 14:06
@patternfly-build
Copy link
Contributor

patternfly-build commented Jul 3, 2024

@tlabaj tlabaj force-pushed the code-editor-resize-observer branch 2 times, most recently from 4760e92 to 53d672c Compare July 3, 2024 20:49
@tlabaj tlabaj force-pushed the code-editor-resize-observer branch from 53d672c to f4267d1 Compare July 9, 2024 20:08
@tlabaj tlabaj requested review from thatblindgeye and kmcfaul July 9, 2024 20:19
@thatblindgeye thatblindgeye merged commit 73bb00a into patternfly:main Jul 11, 2024
13 checks passed
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • @patternfly/react-code-editor@5.4.0-prerelease.24
  • @patternfly/react-core@5.4.0-prerelease.22
  • @patternfly/react-docs@6.4.0-prerelease.34
  • @patternfly/react-drag-drop@5.4.0-prerelease.23
  • demo-app-ts@5.1.1-prerelease.130
  • @patternfly/react-table@5.4.0-prerelease.24
  • @patternfly/react-templates@1.1.0-prerelease.23

Thanks for your contribution! 🎉

tlabaj added a commit to tlabaj/patternfly-react that referenced this pull request Jul 31, 2024
* fix(CodeEditor) resizeObserver resize loop

* yarn

* add debounce

---------

Co-authored-by: Titani <tlabaj@redhat.com>
kmcfaul added a commit that referenced this pull request Aug 8, 2024
* fix(TypeaheadSelect): Add callback on clear selection (#10719)

* fix(CodeEditor) resizeObserver resize loop (#10644)

* fix(CodeEditor) resizeObserver resize loop

* yarn

* add debounce

---------

Co-authored-by: Titani <tlabaj@redhat.com>

* cherry pick fix(SimpleSelect,CheckboxSelect): Handle initial selection(s)

* (Drag and drop): Updated example for multi list to use flex

* docs(Table): add Editable Table example

* fix(DragDrop): fix flexgrow type

* feat(MultiTypeaheadSelect): Add MultiTypeaheadSelect to react-templates (#10757)

* feat(MultiTypeaheadSelect): Add MultiTypeaheadSelect to react-templates

* Update packages/react-templates/src/components/Select/MultiTypeaheadSelect.tsx

Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>

---------

Co-authored-by: Titani Labaj <39532947+tlabaj@users.noreply.github.com>
Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>

* fix(TypeaheadSelect): Correctly show the newly selected item on selection (#10792)

* feat(TypeaheadSelect) Add creation options to TypeaheadSelect (#10802)

* update MultiTypeaheadSelect to use label instead of chip

* chore(deps): upgrade eslint-plugin-react to the latest (#10739)

* chore(deps): upgrade `eslint-plugin-markdown` to the latest version (#10738)

Signed-off-by: Jon Koops <jonkoops@gmail.com>

* resolve merge conflicts

* feat(eslint-plugin-patternfly-react): update rules for eslint v9 (#10743)

* resolve conflicts for chore(deps): upgrade ESLint to the latest version

* fix yarn lint issue

* fix yarn lint issue

* fix(TypeaheadSelect): Update input value only when appropriate (#10826)

* fix lint errors and demo-app

---------

Signed-off-by: Jon Koops <jonkoops@gmail.com>
Co-authored-by: Jeff Phillips <jephilli@redhat.com>
Co-authored-by: Dominik Petřík <77832970+Dominik-Petrik@users.noreply.github.com>
Co-authored-by: kmcfaul <45077788+kmcfaul@users.noreply.github.com>
Co-authored-by: Jon Koops <jonkoops@gmail.com>
tlabaj added a commit that referenced this pull request Oct 4, 2024
tlabaj added a commit to tlabaj/patternfly-react that referenced this pull request Oct 7, 2024
dlabaj pushed a commit that referenced this pull request Oct 7, 2024
* fix(nav):  Reverts PR #10644 that caused regression

* fix failing snapshot tests
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.

Bug - react-code-editor - resizeObserver resize loop
5 participants