feat: implemented dynamic show/hide clear button logic#446
Open
DeepeshKafalatiya wants to merge 1 commit into
Open
feat: implemented dynamic show/hide clear button logic#446DeepeshKafalatiya wants to merge 1 commit into
DeepeshKafalatiya wants to merge 1 commit into
Conversation
Author
|
Hi Mentors, I have successfully implemented the dynamic show/hide logic and clear functionality for the The code has been tested locally and works flawlessly. I have opened a Pull Request for review here: [https://github.com//pull/446] Please let me know if any changes or refinements are needed. Thank you! |
Author
|
Hi Mentors, I have successfully implemented the dynamic show/hide logic and clear functionality for the clearBtn and pasteInput elements. |
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.
Related Issue
Closes #253
Summary
This contribution enhances the UX of the "Smart Paste" text panel by making the "Clear" button dynamic. Instead of remaining statically visible or unlinked, the button now hides automatically when the text area is empty on page load, reveals itself instantly as soon as a user types or pastes text, and smoothly resets the input state upon being clicked.
Changes Made
js/app.jsto ensure the clear button initiates as hidden (display: none) if the textarea contains no text.clearBtnclick event listener to explicitly hide the button instantly and return input.focus()to the text area upon resetting.inputevent listener onpasteInputto actively track value lengths, triggeringclearBtn.style.displaytoggles between'block'and'none'.Testing
Checklist