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: increse z-index of datepicker so that it comes on top of others #10539

Conversation

johnsoncherian
Copy link
Collaborator

@johnsoncherian johnsoncherian commented Jul 31, 2024

fix: increse z-index of datepicker so that it comes on top of other widgets onopen

@TooljetBot
Copy link
Collaborator

TooljetBot commented Jul 31, 2024

Code Review Agent Run #ceb3a5

  • AI Based Review: ✔️ Successful

High-level Feedback

Ensure that the element with the given 'id' exists in the DOM before attempting to change its 'z-index' to prevent runtime errors. Consider adding unit tests to cover these new event handlers and their edge cases to improve reliability.

Actionable Issues

📄 frontend/src/Editor/Components/Datepicker.jsx
Issues: Total - 1, High importance - 1
Line 111-112 🔴 High importance - 1   

AI Code Review powered by Bito Logo

Copy link

sonarcloud bot commented Jul 31, 2024

Comment on lines 111 to 112
onCalendarOpen={() => (document.querySelector(`.ele-${id}`).style.zIndex = 3)}
onCalendarClose={() => (document.querySelector(`.ele-${id}`).style.zIndex = '')}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bito Code Review Agent Run #ceb3a5 - 07/31/2024, 08:20 am

🔴 High importance
Issue: The current implementation does not handle cases where the 'id' is not found in the DOM, which can lead to runtime errors.
Fix: Add a check to ensure that the element with the given 'id' exists in the DOM before attempting to change its 'z-index'.
Code suggestion
 @@ -110,0  111,2 @@
          onCalendarOpen={() => {
            const element = document.querySelector('.ele-${id}');
            if (element) element.style.zIndex = 3;
          }}
          onCalendarClose={() => {
            const element = document.querySelector('.ele-${id}');
            if (element) element.style.zIndex = '';
          }}

Is this a valid issue, or was it incorrectly flagged by the Agent?

  • it was incorrectly flagged

@kavinvenkatachalam kavinvenkatachalam merged commit 8c43c6c into fix/appbuilder-stability-and-ui Jul 31, 2024
31 checks passed
@kavinvenkatachalam kavinvenkatachalam deleted the fix/datepicker-zindex-issue branch July 31, 2024 10:16
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.

4 participants