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.

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.

1 participant