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

Block: Uncontrolled input warning #8096

Closed
spacedmonkey opened this issue Jun 28, 2021 · 0 comments · Fixed by #8242
Closed

Block: Uncontrolled input warning #8096

spacedmonkey opened this issue Jun 28, 2021 · 0 comments · Fixed by #8242
Labels
Group: Blocks Issues related to the provided Gutenberg Blocks Group: WordPress Changes related to WordPress or Gutenberg integration P2 Should do soon Type: Bug Something isn't working

Comments

@spacedmonkey
Copy link
Contributor

Bug Description

While working on #8083, a new E2E test was added. This e2e, brings to light an console error that was making the test fail. The output of this error is the following

expect(jest.fn()).not.toHaveErrored(expected)

    Expected mock function not to be called but it was called with:
    ["Warning: A component is changing an uncontrolled input of type %s to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components%s checkbox·
        in input (created by FormToggle)
        in span (created by FormToggle)
        in FormToggle (created by ToggleControl)
        in div (created by Context.Consumer)
        in StyledField (created by BaseControl)
        in div (created by Context.Consumer)
        in Wrapper (created by BaseControl)
        in BaseControl (created by ToggleControl)
        in ToggleControl (created by storiesInspectorControls__StyledToggle)
        in storiesInspectorControls__StyledToggle (at storiesInspectorControls.js:179)
        in div (created by PanelBody)
        in PanelBody (at storiesInspectorControls.js:164)
        in bubbles_virtually_fill_Fill (created by slot_fill_Fill)
        in slot_fill_Fill (created by InspectorControlsFill)
        in InspectorControlsFill (created by InspectorControls)
        in InspectorControls (at storiesInspectorControls.js:163)
        in StoriesInspectorControls (at edit.js:95)
        in SelectedStoriesEdit (at edit.js:96)
        in Unknown (at configProvider.js:28)
        in ConfigProvider (at edit.js:81)
        in WebStoriesEdit (created by Edit)
        in Edit (created by WithToolbarControls(Edit))
        in WithToolbarControls(Edit) (created by WithInspectorControl(WithToolbarControls(Edit)))
        in WithInspectorControl(WithToolbarControls(Edit)) (created by WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
        in WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))) (created by WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))
        in WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
        in Unknown (created by WithDispatch(Component))
        in WithDispatch(Component)
        in Unknown (created by WithMultipleValidation(WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))
        in WithMultipleValidation(WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))) (created by WithFilters(Edit))
        in WithFilters(Edit) (created by block_edit_BlockEdit)
        in block_edit_BlockEdit (created by block_BlockListBlock)
        in div (created by Block)
        in Block (created by block_BlockListBlock)
        in BlockCrashBoundary (created by block_BlockListBlock)
        in block_BlockListBlock (created by (block_BlockListBlock))
        in (block_BlockListBlock) (created by ((block_BlockListBlock)))
        in ((block_BlockListBlock)) (created by WithFontSizeInlineStyles(((block_BlockListBlock))))
        in WithFontSizeInlineStyles(((block_BlockListBlock))) (created by WithFilters(block_BlockListBlock))
        in WithFilters(block_BlockListBlock) (created by IfCondition(WithFilters(block_BlockListBlock)))
        in IfCondition(WithFilters(block_BlockListBlock)) (created by WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
        in WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))
        in Unknown (created by Pure(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))))
        in Pure(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))) (created by Items)
        in Items (created by BlockListItems)
        in BlockListItems (created by BlockList)
        in div (created by BlockList)
        in BlockList (created by VisualEditor)
        in div (created by WritingFlow)
        in WritingFlow (created by VisualEditor)
        in div (created by VisualEditor)
        in div (created by VisualEditor)
        in VisualEditor (created by Layout)
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in ForwardRef(InterfaceSkeleton) (created by Layout)
        in Layout (created by Editor)
        in ErrorBoundary (created by Editor)
        in BlockEditorProvider
        in Unknown (created by Context.Consumer)
        in WithRegistryProvider(BlockEditorProvider) (created by EditorProvider)
        in BlockContextProvider (created by EditorProvider)
        in EntityProvider (created by EditorProvider)
        in EntityProvider (created by EditorProvider)
        in EditorProvider
        in Unknown (created by Context.Consumer)
        in WithRegistryProvider(EditorProvider) (created by Editor)
        in DropZoneContextProvider (created by Editor)
        in slot_fill_provider_SlotFillProvider (created by SlotFillProvider)
        in SlotFillProvider (created by Editor)
        in StrictMode (created by Editor)
        in Editor"],["Warning: Failed prop type: Invalid prop `currentAuthor` of type `array` supplied to `SelectStories`, expected `string`.
        in SelectStories (at storyPicker.js:263)
        in StoryPicker (at embedPlaceholder.js:105)
        in div (created by Placeholder)
        in div (created by Placeholder)
        in Placeholder (created by embedPlaceholder__SelectStoriesPlaceholder)
        in embedPlaceholder__SelectStoriesPlaceholder (at embedPlaceholder.js:90)
        in EmbedPlaceholder (at edit.js:109)
        in Unknown (at apiProvider.js:64)
        in StoriesBlockApiProvider (at edit.js:108)
        in Ge (at edit.js:107)
        in SelectedStoriesEdit (at edit.js:96)
        in Unknown (at configProvider.js:28)
        in ConfigProvider (at edit.js:81)
        in WebStoriesEdit (created by Edit)
        in Edit (created by WithToolbarControls(Edit))
        in WithToolbarControls(Edit) (created by WithInspectorControl(WithToolbarControls(Edit)))
        in WithInspectorControl(WithToolbarControls(Edit)) (created by WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
        in WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))) (created by WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit)))))
        in WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))
        in Unknown (created by WithDispatch(Component))
        in WithDispatch(Component)
        in Unknown (created by WithMultipleValidation(WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))))
        in WithMultipleValidation(WithToolbarControls(WithInspectorControl(WithInspectorControl(WithToolbarControls(Edit))))) (created by WithFilters(Edit))
        in WithFilters(Edit) (created by block_edit_BlockEdit)
        in block_edit_BlockEdit (created by block_BlockListBlock)
        in div (created by Block)
        in Block (created by block_BlockListBlock)
        in BlockCrashBoundary (created by block_BlockListBlock)
        in block_BlockListBlock (created by (block_BlockListBlock))
        in (block_BlockListBlock) (created by ((block_BlockListBlock)))
        in ((block_BlockListBlock)) (created by WithFontSizeInlineStyles(((block_BlockListBlock))))
        in WithFontSizeInlineStyles(((block_BlockListBlock))) (created by WithFilters(block_BlockListBlock))
        in WithFilters(block_BlockListBlock) (created by IfCondition(WithFilters(block_BlockListBlock)))
        in IfCondition(WithFilters(block_BlockListBlock)) (created by WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))
        in WithDispatch(IfCondition(WithFilters(block_BlockListBlock)))
        in Unknown (created by Pure(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))))
        in Pure(WithSelect(WithDispatch(IfCondition(WithFilters(block_BlockListBlock))))) (created by Items)
        in Items (created by BlockListItems)
        in BlockListItems (created by BlockList)
        in div (created by BlockList)
        in BlockList (created by VisualEditor)
        in div (created by WritingFlow)
        in WritingFlow (created by VisualEditor)
        in div (created by VisualEditor)
        in div (created by VisualEditor)
        in VisualEditor (created by Layout)
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in div (created by ForwardRef(InterfaceSkeleton))
        in ForwardRef(InterfaceSkeleton) (created by Layout)
        in Layout (created by Editor)
        in ErrorBoundary (created by Editor)
        in BlockEditorProvider
        in Unknown (created by Context.Consumer)
        in WithRegistryProvider(BlockEditorProvider) (created by EditorProvider)
        in BlockContextProvider (created by EditorProvider)
        in EntityProvider (created by EditorProvider)
        in EntityProvider (created by EditorProvider)
        in EditorProvider
        in Unknown (created by Context.Consumer)
        in WithRegistryProvider(EditorProvider) (created by Editor)
        in DropZoneContextProvider (created by Editor)
        in slot_fill_provider_SlotFillProvider (created by SlotFillProvider)
        in SlotFillProvider (created by Editor)
        in StrictMode (created by Editor)
        in Editor"]

      at Object.assertExpectedCalls (../../../node_modules/@wordpress/jest-console/build/@wordpress/jest-console/src/index.js:36:4)
          at runMicrotasks (<anonymous>)

Expected Behaviour

Steps to Reproduce

Screenshots

Additional Context

  • Plugin Version:
  • WordPress Version:
  • Operating System:
  • Browser:

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

Implementation Brief

@spacedmonkey spacedmonkey added Type: Bug Something isn't working Group: WordPress Changes related to WordPress or Gutenberg integration Pod: WP & Infra Group: Blocks Issues related to the provided Gutenberg Blocks labels Jun 28, 2021
@swissspidy swissspidy changed the title Console error in gutenblock Block: Uncontrolled input warning Jun 28, 2021
@swissspidy swissspidy added the P2 Should do soon label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group: Blocks Issues related to the provided Gutenberg Blocks Group: WordPress Changes related to WordPress or Gutenberg integration P2 Should do soon Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants