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(tp/con): misc fixes #674

Merged
merged 20 commits into from Apr 18, 2024
Merged

fix(tp/con): misc fixes #674

merged 20 commits into from Apr 18, 2024

Conversation

katamatata
Copy link
Contributor

@katamatata katamatata commented Mar 1, 2023

What Github issue does this PR relate to? Insert link.

#387

What should the reviewer know?

Done:

  • Fixed the color of the FormSelect input field and added typed props.
  • Fixed the select dropdown icon not rotating on state change.
  • Fixed floating dropdowns.

Screenshots

Screen.Recording.2023-03-13.at.22.22.30.mov

@katamatata katamatata changed the title fix(tp): misc fixes fix(tp/con): misc fixes Mar 9, 2023
@katamatata katamatata marked this pull request as ready for review March 9, 2023 15:56
@katamatata katamatata linked an issue Mar 9, 2023 that may be closed by this pull request
Copy link
Contributor

@ericbolikowski ericbolikowski left a comment

Choose a reason for hiding this comment

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

@katamatata, good work here. I know how much testing was required to make this happen.

A simple pattern strikes me: whenever the menuPosition prop is set, the menuPortalTarget prop is set to document.body. How about we:

  • remove the menuPortalTarget as a prop
  • narrow down menuPosition to the same values accepted by <Select menuPosition={}> (see this for how to access the correct type)
  • inside of our <FormSelect> component, conditionally set menuPortalTarget to document.body if Boolean(menuPosition)

@ericbolikowski
Copy link
Contributor

I'm also curious to see what @helloanil thinks of this PR.

@helloanil
Copy link
Contributor

The PR looks good to me except the thing @ericbolikowski mentioned. What @ericbolikowski mentions definitely makes sense and cleans up the clutter however as far as I see, the solution in this PR is not really working. We simply fix it for some Selects, but not for others. See here:

CleanShot.2023-03-12.at.20.39.23.mp4

I really liked the idea that the Selects at the upper section of the Modal are more likely to be impacted by scrolling in the modal so it's smart to tackle them but not the ones at the bottom. However, depending on the screen size and resolution of the user, the Selects we decide to fix or not here might still impact the UX.

I gave it a little look and found this issue. So apparently we were not the only ones who are impacted. There are several solutions recommended and liked by others, in the long issue thread. But the real solution that fixed the issue seemed to be bumping up the react-select version to v5.5.0 or later.

We are currently using v3 which is 2 versions below the fixed version. This means there are some breaking changes and we need to be careful that everything works, if we go ahead and update. There are two things need to be done:

  1. Read the changelogs from 3 => 4 and 4 =>, understand the breaking changes and see if we have any use cases impacted by those breaking changes.
  2. Do a regression test on the components and pages we use react-select library.

@katamatata @ericbolikowski Sorry for making this comment this long. I definitely don't want this PR to stay around too long and become a pain in the butt for anyone. I'm happy to approve it with the slight improvement that Eric suggests. However then I would love to see us working on the react-select v5 migration to put the real nail in the coffin 🔨 ⚰️

Let me know what you think!

@katamatata
Copy link
Contributor Author

Thanks for your comment and thorough testing, @helloanil!
You are right, all the dropdowns with menuPosition="fixed" are still floating (at some viewport). I tried some solutions from that thread, but they didn't solve it. So, I agree we need to try upgrading react-select to the latest version.

@gitguardian
Copy link

gitguardian bot commented Apr 27, 2023

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Copy link

coderabbitai bot commented Mar 27, 2024

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@katamatata katamatata marked this pull request as draft March 27, 2024 12:57
@ericbolikowski ericbolikowski merged commit b73028f into master Apr 18, 2024
2 checks passed
@ericbolikowski ericbolikowski deleted the bug-fixes branch April 18, 2024 06:53
@ericbolikowski ericbolikowski restored the bug-fixes branch April 18, 2024 06:54
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.

[TP/CON]: Floating dropdowns
3 participants