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

optimize react select #654

Merged
merged 1 commit into from
Jul 29, 2024
Merged

optimize react select #654

merged 1 commit into from
Jul 29, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Jul 29, 2024

🚀 This description was created by Ellipsis for commit 3094fab

Summary:

Optimized React Select dropdown handling in skyvern/webeye by updating selectors and improving interaction methods.

Key points:

  • skyvern/webeye/scraper/domUtils.js:
    • Updated getReactSelectOptionElements to use div[class*='select__option'] for option selection.
    • Added code to save and restore scroll position.
    • Added mouse and keyboard events to handle dropdown interactions.
  • skyvern/webeye/utils/dom.py:
    • Updated ReactSelectDropdown.__find_input_locator to use input[class*='select__input'].
    • Modified ReactSelectDropdown.get_current_value to use div[class*='select__single-value'].
    • Updated ReactSelectDropdown.select_by_index to use div[class*='select__option'].
    • Changed ReactSelectDropdown.open to use focus and ArrowDown key press for opening the dropdown.
    • Changed ReactSelectDropdown.close to use Escape key press for closing the dropdown.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 3094fab in 1 minute and 8 seconds

More details
  • Looked at 115 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_NUdKSElFoIXQYfqA


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -714,7 +717,7 @@ async function getReactSelectOptionElements(element) {
// sometimes need more time to load the options
console.log("wait 5s to load all options");
await sleep(5000); // wait 5s
optionList = dropdownDiv.querySelectorAll("div[role='option']");
optionList = dropdownDiv.querySelectorAll("div[class*='select__option']");
Copy link
Contributor

Choose a reason for hiding this comment

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

The change from div[role='option'] to div[class*='select__option'] needs clarification on its necessity and impact. Ensure it doesn't affect existing functionalities that might rely on the previous selector. This comment applies to all similar changes in this PR.

@LawyZheng LawyZheng merged commit f771cbb into main Jul 29, 2024
2 checks passed
@LawyZheng LawyZheng deleted the optimize-react-select branch July 29, 2024 07:32
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