Skip to content

Conversation

@engijlr
Copy link
Contributor

@engijlr engijlr commented Oct 17, 2025

Summary

  • Implements Mandatory behavior for the Icon Picker property editor:
  • Hides the “empty” option in the modal when the field is mandatory.
  • Adds real form validation (blocks Save/Publish when required and no icon is selected).
  • Uses the form-control mixin so the picker participates in Umbraco’s validation lifecycle.

Changes

  • Extends UmbFormControlMixin<string, typeof UmbLitElement, undefined>.
  • Adds a validator in firstUpdated: this.addValidator('valueMissing', () => 'Icon is required', () => this.mandatory && !this._icon);
  • Uses super.value as the single source of truth in the value getter/setter.
  • Parses _icon/_color from value for rendering.
  • Passes showEmptyOption: !this.mandatory to the icon picker modal to control the “empty” tile.

Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

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

works well, thanks!

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) October 23, 2025 13:08
@nielslyngsoe nielslyngsoe merged commit 8434c7d into main Oct 23, 2025
26 of 27 checks passed
@nielslyngsoe nielslyngsoe deleted the v17/bugfix/icon-picker-validation branch October 23, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants