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: Date picker shouldn't appear on top of the date field #36359

Conversation

venkatalakshmimaddu
Copy link

@venkatalakshmimaddu venkatalakshmimaddu commented Sep 17, 2024

Fixes: #35794

Hi @carinanfonseca

What's in the pr :

  • Initially, the date picker was appearing on top of the date field.
  • Updated the date picker component by adding props to adjust the popover position to the right.
  • Now, the date picker popover consistently appears on the right side of the date field.

Before :

image

After :

image

Summary by CodeRabbit

  • New Features
    • Enhanced the Date Picker component with improved popover positioning and behavior.
    • The popover now stays within viewport boundaries and does not flip when overflowing.

Copy link
Contributor

coderabbitai bot commented Sep 17, 2024

Walkthrough

The changes introduced in the DatePickerWidget2 component involve configuring the placement and behavior of the date picker popover. A new position property is set to Position.RIGHT, ensuring the popover appears to the right of the trigger element. Additionally, modifiers are added to control the popover's behavior: flip is disabled to maintain its position and preventOverflow is enabled to keep it within the viewport.

Changes

Files Change Summary
app/client/src/widgets/DatePickerWidget2/component/index.tsx Added position: Position.RIGHT and modifiers to control popover behavior in the DatePickerComponent class.

Assessment against linked issues

Objective Addressed Explanation
Date picker shouldn't appear on top of the date field (#[35794])

Possibly related PRs

  • fix: Fix datepicker issue with aghelper #36325: This PR involves changes to the DatePicker widget's functionality, which is directly related to the modifications made in the main PR regarding the DatePickerComponent's behavior and configuration.

Suggested labels

Bug, ok-to-test

Poem

In the realm of dates, a popover takes flight,
Positioned just right, it shines so bright.
No more hiding fields, it stands with grace,
A user-friendly change in this digital space!
With modifiers in tow, it won't go astray,
Keeping all within bounds, come what may! 🌟


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a6b7644 and 409abfb.

Files selected for processing (1)
  • app/client/src/widgets/DatePickerWidget2/component/index.tsx (2 hunks)
Additional comments not posted (2)
app/client/src/widgets/DatePickerWidget2/component/index.tsx (2)

393-397: Excellent work on improving the date picker's usability! 🎉

By setting the position property to Position.RIGHT and configuring the flip and preventOverflow modifiers, you've ensured that the date picker will consistently appear to the right of the date field without overflowing the viewport. This enhances the user experience by improving the visibility and predictability of the date picker's behavior.

Great job on addressing the issue and making the date picker more user-friendly! 👍


5-5: Good job on adding the necessary import statement! 👌

You've correctly imported the Position constant from the @blueprintjs/core library, which is required to set the position property in the popoverProps. This ensures that the code has access to the necessary constants and prevents any potential errors.

Keep up the great work on maintaining clean and organized imports! 🙌


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 generate interesting stats about this repository and render them as a table.
    -- @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.

@@ -390,6 +390,11 @@ class DatePickerComponent extends React.Component<
usePortal: !this.props.withoutPortal,
canEscapeKeyClose: true,
portalClassName: `${DATEPICKER_POPUP_CLASSNAME}-${this.props.widgetId}`,
position: Position.RIGHT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Any test needs to add or updated here?

Copy link
Author

@venkatalakshmimaddu venkatalakshmimaddu Sep 20, 2024

Choose a reason for hiding this comment

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

No need of test cases updation, that is just one style change

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 27, 2024
Copy link

github-actions bot commented Oct 4, 2024

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this Oct 4, 2024
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.

Date picker shouldn't appear on top of the date field
2 participants