Skip to content

fix: keep a pending follow button from flipping to Unfollow under the pointer - #822

Open
sulimanbenhalim wants to merge 1 commit into
dev-null-sh:productionfrom
sulimanbenhalim:fix/follow-hover-while-pending
Open

sulimanbenhalim wants to merge 1 commit into
dev-null-sh:productionfrom
sulimanbenhalim:fix/follow-hover-while-pending

Conversation

@sulimanbenhalim

Copy link
Copy Markdown
Contributor

right after following someone the button flips to a red Unfollow under the pointer even though useFollowHover is there to keep it on Following until the pointer leaves
since #573 a pending follow renders the button disabled and the base Button has disabled:pointer-events-none so the browser fires a mouseleave as soon as the request starts and that resets the guard

keeping pointer events on the pending follow button fixes it
it's still disabled so clicks during the request do nothing and a double click still sends a single follow
moving away and back still shows Unfollow like before

follow-hover-before-after

added a test in FollowState.test.tsx that fails without the change

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