fix(Table): show row hover gradient when only hoverActions is passed (closes #3281)#3341
Open
Mrsandeep27 wants to merge 1 commit intorazorpay:masterfrom
Open
fix(Table): show row hover gradient when only hoverActions is passed (closes #3281)#3341Mrsandeep27 wants to merge 1 commit intorazorpay:masterfrom
Mrsandeep27 wants to merge 1 commit intorazorpay:masterfrom
Conversation
A TableRow's $isHoverable flag was computed from Boolean(onHover) ||
Boolean(onClick) only, so rows that passed hoverActions without either
callback rendered the actions on hover but no background gradient under
them — the row looked static while actions popped in.
Include hoverActions in the hoverable check:
$isHoverable = !isDisabled &&
(Boolean(onHover) || Boolean(onClick) || Boolean(hoverActions))
Closes razorpay#3281
Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 29e1320 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 29e1320:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Closes #3281 — reported by @anuraghazra.
The row hover gradient on `TableRow` was gated behind `Boolean(onHover) || Boolean(onClick)` only. Tables that used hover-revealed actions without a click or hover handler (`hoverActions` alone) saw the actions appear on hover but no underlying row highlight — the row looked static while the actions popped in, which is visually inconsistent with how hoverable rows normally read.
Root cause
`packages/blade/src/components/Table/TableBody.web.tsx` line 394 (before):
```tsx
$isHoverable={isDisabled ? false : Boolean(onHover) || Boolean(onClick)}
```
The hover-state CSS block at line 283-293 only applies when `$isHoverable || $isSelectable` is true. A row with `hoverActions` but no `onHover`/`onClick` and no selection → neither condition fires → no gradient.
Fix
Include `hoverActions` in the `$isHoverable` computation:
```tsx
$isHoverable={
isDisabled ? false : Boolean(onHover) || Boolean(onClick) || Boolean(hoverActions)
}
```
One-line change. Hoverable disabled rows stay non-hoverable (the `isDisabled` short-circuit is preserved).
Scope
Test plan
Checklist
🤖 Generated with Claude Code