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

fix:retained input reference on x icon click #36268

Conversation

saiprabhu-dandanayak
Copy link
Contributor

@saiprabhu-dandanayak saiprabhu-dandanayak commented Sep 12, 2024

Description

Fixes : #18536

I have raised this pr in-order to retain the cursor position inside the search field when clicking on the x icon .

Screenshots

Table

Screenshot from 2024-09-12 13-56-18

SingleSelectTree

Screenshot from 2024-09-12 13-57-21

MultiTreeSelect

image

MultiSelect

image

Summary by CodeRabbit

  • New Features

    • Enhanced search and filter clearing functionality across multiple components to automatically focus the input field after clearing, improving user experience.
  • Bug Fixes

    • Added focus actions to clear buttons in various components to ensure immediate interaction with the input field post-clear.
  • Documentation

    • Added console log statements for better tracking of query changes and dropdown opening events in the SelectComponent.

Copy link
Contributor

coderabbitai bot commented Sep 12, 2024

Walkthrough

The changes in this pull request enhance user interaction by adding focus functionality to input elements when clear buttons are clicked across various components. Specifically, the SearchComponent, MultiSelectTreeWidget, MultiSelectWidgetV2, SingleSelectTreeWidget, and SelectWidget have been updated to ensure that the input field regains focus after clearing its contents, improving usability. Additionally, the SelectComponent includes new console log statements for debugging purposes.

Changes

File Path Change Summary
app/client/packages/design-system/widgets-old/src/SearchComponent/index.tsx Added a private property inputRef to focus the input field after clearing the search.
app/client/src/widgets/MultiSelectTreeWidget/component/index.tsx Enhanced clearButton to focus the input field after clearing the filter.
app/client/src/widgets/MultiSelectWidgetV2/component/index.tsx Modified clearButton to focus the input field before clearing the filter.
app/client/src/widgets/SelectWidget/component/index.tsx Added console logs in onQueryChange and onOpening methods for debugging purposes.
app/client/src/widgets/SingleSelectTreeWidget/component/index.tsx Updated clearButton to focus the input field after resetting the filter state.

Possibly related PRs

Suggested labels

Bug, Anvil team, ok-to-test

Poem

In the land of code where inputs reside,
A clear button now brings focus with pride.
With a click, the search field awaits,
Ready for typing, it patiently states.
Debugging logs whisper, "We're here to assist,"
Enhancing the flow, none can resist! ✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@saiprabhu-dandanayak
Copy link
Contributor Author

@appsmithorg/query-js-pod , Please add reviewer for this pr if you have enough bandwidth.
Thanks in advance.

@NilanshBansal
Copy link
Contributor

Assigned @rahulbarwal @jacquesikot from Widgets team for review. cc: @carinanfonseca

@saiprabhu-dandanayak
Copy link
Contributor Author

Hi @jacquesikot , could you pls review this pr , pls let me know any changes needs to be done.
Thanks in advance.

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Sep 23, 2024
@saiprabhu-dandanayak
Copy link
Contributor Author

Hi @jacquesikot , could you pls review this pr , pls let me know any changes needs to be done. dute to inactivity pr got stale labelled.
Thanks in advance.

Copy link
Contributor

@rahulbarwal rahulbarwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests. Please add tests(unit, preferably) for these changes.

app/client/src/widgets/SelectWidget/component/index.tsx Outdated Show resolved Hide resolved
app/client/src/widgets/SelectWidget/component/index.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the Stale label Sep 24, 2024
@rahulbarwal
Copy link
Contributor

@saiprabhu-dandanayak quality checks are failing, please fix them: https://github.com/appsmithorg/appsmith/actions/runs/11046247172/job/30685240765?pr=36553

You can run the failing commands on your local to confirm if the issue has been fixed.

Copy link
Contributor

@rahulbarwal rahulbarwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is still failing 😞 : https://github.com/appsmithorg/appsmith/actions/runs/11065536238/job/30745146672?pr=36553
Please check.

One more thing, lets not name our test file index.test.tsx : this does not tell me anything about the tests.

@rahulbarwal
Copy link
Contributor

rahulbarwal commented Oct 1, 2024

Hey @saiprabhu-dandanayak, All three commands are failing on your latest changes:

  • yarn run lint:ci
  • yarn run test:unit:ci
  • yarn run check-types

here is a sample run: https://app.warp.dev/block/Hwm6Md43BhO2h02LSBQTx8

Can you try all three commands in your local and get back when they succeed?

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Oct 17, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Oct 27, 2024
@jacquesikot
Copy link
Contributor

Hey @saiprabhu-dandanayak are you still working on this PR - have you been able to address the issues @rahulbarwal mentioned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]-[4000]:On clicking the 'x' icon in search fields, retain the cursor position inside the search field
4 participants