Skip to content

Fixes fancy-box.tsx bugs#14

Open
AbrahamX3 wants to merge 1 commit intomxkaske:mainfrom
AbrahamX3:patch-1
Open

Fixes fancy-box.tsx bugs#14
AbrahamX3 wants to merge 1 commit intomxkaske:mainfrom
AbrahamX3:patch-1

Conversation

@AbrahamX3
Copy link

What does this PR fix?

  • Appending space bug removes create new button
  • Spamming search input freezes browser tab.

Notes and Research

The Freezing

Upon investigating the freezes, I tested with some debounce hooks to see if it fixes the issue, which It did. Testing with different delays it seems like it worked with the most minimal delay (0.1), In the code I am providing, I used a simple setTimeout with a delay of 0.1. The risk of a memory leak is very minimal, but I recommend a full-fledged debounce hook with a cleanup function if used in production. This stops the freezing, although it does get a bit laggy if you do end up spamming for quite a while.

The space bug

The code provided successfully identifies the spaces or whitespace and adds it to the render condition; it also trims out the value if you do have some whitespace, you're still able to add labels with a space and trims it upon creating a new label.

Demonstration

Testing spam freezes

chrome_3oHVmdHvep.mp4

Testing space bug

chrome_P305WgxSAy.mp4

@vercel
Copy link

vercel bot commented Mar 6, 2024

Someone is attempting to deploy a commit to a Personal Account owned by @mxkaske on Vercel.

@mxkaske first needs to authorize it.

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