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 default-values for multiple-select in blocks #5576

Merged
merged 3 commits into from
Nov 2, 2020

Conversation

Prokyonn
Copy link
Member

@Prokyonn Prokyonn commented Oct 28, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #4987
License MIT
Documentation PR sulu/sulu-docs#prnum

What's in this PR?

Fixes the default-values in blocks. See #4987

An additional value attribute is introduced to save the state of the value. Previously the value was saved in the properties (this.props), but the properties are updated after the default-value is set for the next single_select, thus the value is not up to date during the rendering of the other components.

Now the new value attribute is manually updated before the next component is rendered.

Why?

The default value was only working for the last component.

Todo

  • Tests
  • Rebase to 2.1
  • Check Imagemap

@alexander-schranz alexander-schranz added the Bug Error or unexpected behavior of already existing functionality label Oct 28, 2020
@Prokyonn Prokyonn changed the base branch from master to release/2.1 October 29, 2020 09:38
@niklasnatter
Copy link
Contributor

Reminder: Check if we need to do something similar for the ImageMap when merging this 🙂

Copy link
Contributor

@danrot danrot left a comment

Choose a reason for hiding this comment

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

I think that's a better solution than the two I came up with 👍

So I am generally fine with that, still added a few minor issues resp. questions for better understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple default values do not work inside of blocks
4 participants