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

rate-component output rateLeave #8415

Open
imaliouris opened this issue Feb 23, 2024 · 0 comments
Open

rate-component output rateLeave #8415

imaliouris opened this issue Feb 23, 2024 · 0 comments
Assignees

Comments

@imaliouris
Copy link

What problem does this feature solve?

I am trying to use an icon for non selected items and another icon for selected items.
Everything is fine except the hover effect.
When I hover on non selected items the non selected icon is shown instead of the selected one. I have already used (nzOnHoverChange) but it doesn't emit when leaving the rate.
In my opinion there are 2 options

  1. Introduce a new event called (nzOnRateLeave)
  2. Emit (nzOnHoverChange) when leaving the rate.

What does the proposed API look like?

Option 1 - new event (nzOnRateLeave)

@Output() readonly nzOnRateLeave = new EventEmitter<void>();

onRateLeave(): void {
    this.hasHalf = !Number.isInteger(this.nzValue);
    this.hoverValue = Math.ceil(this.nzValue);
    this.nzOnRateLeave.emit()

    this.updateStarStyle();
  }

Option 2 - trigger existing event (nzOnHoverChange)

onRateLeave(): void {
    this.hasHalf = !Number.isInteger(this.nzValue);
    this.hoverValue = Math.ceil(this.nzValue);
    this.nzOnHoverChange.emit(this.hoverValue)

    this.updateStarStyle();
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants