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

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

rate-component output rateLeave #8415

imaliouris opened this issue Feb 23, 2024 · 0 comments
Assignees
Labels
👌 Already Fixed There is already a PR trying to solve this Component: Rate

Comments

@imaliouris
Copy link
Contributor

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();
  }
@Nicoss54 Nicoss54 self-assigned this Feb 28, 2024
@Laffery Laffery closed this as completed Jun 7, 2024
@Laffery Laffery added the 👌 Already Fixed There is already a PR trying to solve this label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👌 Already Fixed There is already a PR trying to solve this Component: Rate
Projects
None yet
Development

No branches or pull requests

3 participants