Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 18, 2025

  • Explore repository structure and locate igcCombo component
  • Understand how boolean properties are implemented in combo.ts
  • Review renderClearIcon method and how it's currently used
  • Add new disableClear property to combo component
  • Update renderClearIcon to respect the new property
  • Add tests for the new property
  • Update Storybook argTypes for the new property
  • Run type checking (passed)
  • Run linting (passed)
  • Run security checks (CodeQL - 0 alerts)
  • Verify implementation follows existing patterns
  • Optimize condition check order for performance

Summary

Added a new disableClear boolean property to the igc-combo component that hides the clear button (X icon) when set to true.

Changes:

  1. combo.ts: Added disableClear property with @property decorator, attribute name disable-clear, default value false
  2. combo.ts: Updated renderClearIcon() to hide button when this.disableClear || this._selection.isEmpty (optimized check order)
  3. combo.spec.ts: Added 2 unit tests to verify the property works correctly
  4. combo.stories.ts: Added property to Storybook argTypes for documentation

Usage:

<igc-combo disable-clear></igc-combo>

or

combo.disableClear = true;

The implementation is minimal, follows existing patterns, and maintains backward compatibility (default is false). The condition check order has been optimized to check disableClear first for better performance.

Original prompt

This section details on the original issue you should resolve

<issue_title>Provide an option for igcCombo to disallow clearing the value (i.e. remove the X button)</issue_title>
<issue_description>Estimated Delivery Sprint - Sprint X

  • Research
  • Specification
  • Component and tests implementation
  • API Documentation
  • Design implementation
    </issue_description>

<agent_instructions>The igxCombo needs a new option, which hides the clear value button when set.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #1516


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 18, 2025 08:59
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
@kdinev kdinev changed the title [WIP] Add option to igxCombo to disallow clearing value [WIP] Add option to igcCombo to disallow clearing value Oct 18, 2025
@Copilot Copilot AI changed the title [WIP] Add option to igcCombo to disallow clearing value Add disableClear property to hide clear button in igc-combo component Oct 18, 2025
@Copilot Copilot AI requested a review from kdinev October 18, 2025 09:08
Copilot finished work on behalf of kdinev October 18, 2025 09:08
part="clear-icon"
@click=${this.handleClearIconClick}
?hidden=${this._selection.isEmpty}
?hidden=${this._selection.isEmpty || this.disableClear}
Copy link
Member

@kdinev kdinev Oct 18, 2025

Choose a reason for hiding this comment

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

@copilot Do the disableClear check first, because if the property is set to true, then the logic doesn't need to get to an isEmpty check ever. It would be slightly more performant.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the condition order to check disableClear first for better performance: ?hidden=${this.disableClear || this._selection.isEmpty} (commit: b4b73b5)

Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
@Copilot Copilot AI requested a review from kdinev October 18, 2025 09:13
Copilot finished work on behalf of kdinev October 18, 2025 09:13
@kdinev kdinev marked this pull request as ready for review October 18, 2025 09:15
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.

Provide an option for igcCombo to disallow clearing the value (i.e. remove the X button)

2 participants