You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$500] Press highlight on a field in expense details overlaps with error message weirdly #34944
changed the title [-]Press highlight on a field in expense details overlaps with error message weirdly[/-][+][$500] Press highlight on a field in expense details overlaps with error message weirdly[/+]on Jan 23, 2024
What changes do you think we should make in order to solve the problem?
We should remove margin top.
Result
Result with no negative margin:
Result with children prop and updating some stylings:
What alternative solutions did you explore? (Optional)
I think the best we can do here is to accept children prop inside MenuItem and use ViolationMessages component as a children.
Or we should use error prop in MenuItemWithTopDescription to show the error. We have already used error prop, we can use errorText to show the ViolationMessages.
What changes do you think we should make in order to solve the problem?
The reason for the negative margin is to decrease the space between the error and the menu description. But I think we can decrease the padding vertical of the menu description by adding wrapperStyle prop into MenuItemWithTopDescription if we can use violation transaction
What alternative solutions did you explore? (Optional)
We can combine the violation message with line break and pass this into MenuItemWithTopDescription or allow pass array error prop into MenuItemWithTopDescription
So when the hover/press effect change the color of the background, the zone where the message is displayed will not be effected.
And because ViolationMessages has a negative margin that bring it more to the top, it seem that it's part of the hover zone, but it's not, it's another DIV where no hover effect applied to it.
What changes do you think we should make in order to solve the problem?
The MenuItemWithTopDescription support displaying error via already existant props errorText.
/** Error to display at the bottom of the component */
errorText?: string;
We should pass the violation message throw it and remove ViolationMessages component.
<MenuItemWithTopDescription
description={translate('common.category')}
// ...
// we can use error or errorText
+ errorText="Error!" // will put violation message here mapped
/>
- {canUseViolations && <ViolationMessages violations={getViolationsForField('category')} />}
Picking the righ props and code perfection can be discussed throw PR.
POC:
What alternative solutions did you explore?
Edit MenuItem to that props error or errorText support non only string but an array too.
Activity
melvin-bot commentedon Jan 23, 2024
Triggered auto assignment to @JmillsExpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Press highlight on a field in expense details overlaps with error message weirdly[/-][+][$500] Press highlight on a field in expense details overlaps with error message weirdly[/+]melvin-bot commentedon Jan 23, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01b61739c3e4f7859e
melvin-bot commentedon Jan 23, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel (
External)Krishna2323 commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Press highlight on a field in expense details overlaps with error message weirdly
What is the root cause of that problem?
In the
ViolationMessagescomponent we have-8pxof margin top.App/src/components/ViolationMessages.tsx
Line 15 in 9c552ab
What changes do you think we should make in order to solve the problem?
We should remove margin top.
Result
Result with no negative margin:

Result with children prop and updating some stylings:

What alternative solutions did you explore? (Optional)
MenuItemand useViolationMessagescomponent as a children.Or we should useerrorprop inMenuItemWithTopDescriptionto show the error. We have already usederrorprop, we can useerrorTextto show theViolationMessages.jeremy-croff commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Highlighted area doesn't include the full row when there's an error message
What is the root cause of that problem?
The highlight style doesn't grow into full row when there's an error message.
What changes do you think we should make in order to solve the problem?
We should update the styling to flex the highlighted area based on the content, inccluding the error message
What alternative solutions did you explore? (Optional)
Krishna2323 commentedon Jan 23, 2024
Proposal Updated
Included more alternative options.
Krishna2323 commentedon Jan 23, 2024
Proposal Updated
Included results screenshots & permalink.
dukenv0307 commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
overlaps the error message weirdly
What is the root cause of that problem?
We have a negative margin here so the expense details overlaps the error violation message
App/src/components/ViolationMessages.tsx
Line 15 in 9c552ab
What changes do you think we should make in order to solve the problem?
The reason for the negative margin is to decrease the space between the error and the menu description. But I think we can decrease the padding vertical of the menu description by adding
wrapperStyleprop intoMenuItemWithTopDescriptionif we can use violation transactionRef: #32594 (comment)
App/src/components/ViolationMessages.tsx
Line 15 in 9c552ab
What alternative solutions did you explore? (Optional)
We can combine the violation message with line break and pass this into
MenuItemWithTopDescriptionor allow pass array error prop intoMenuItemWithTopDescriptiondragnoir commentedon Jan 23, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Error message out of hover frame
What is the root cause of that problem?
Inside MoneyRequestView we are displaying the error message via
ViolationMessagesbut the only hovered component isMenuItemWithTopDescriptionApp/src/components/ReportActionItem/MoneyRequestView.js
Lines 335 to 348 in 0bdbfbb
So when the hover/press effect change the color of the background, the zone where the message is displayed will not be effected.
And because
ViolationMessageshas a negative margin that bring it more to the top, it seem that it's part of the hover zone, but it's not, it's another DIV where no hover effect applied to it.What changes do you think we should make in order to solve the problem?
The
MenuItemWithTopDescriptionsupport displaying error via already existant props errorText.App/src/components/MenuItem.tsx
Lines 589 to 596 in 0bdbfbb
App/src/components/MenuItem.tsx
Lines 134 to 138 in 0bdbfbb
We should pass the violation message throw it and remove
ViolationMessagescomponent.<MenuItemWithTopDescription description={translate('common.category')} // ... // we can use error or errorText + errorText="Error!" // will put violation message here mapped /> - {canUseViolations && <ViolationMessages violations={getViolationsForField('category')} />}Picking the righ props and code perfection can be discussed throw PR.
POC:

What alternative solutions did you explore?
Edit MenuItem to that props
errororerrorTextsupport non only string but an array too.luacmartins commentedon Jan 23, 2024
Seems like a dupe of #33527. @cead22 can you confirm if we're already fixing this?
aimane-chnaif commentedon Jan 23, 2024
It's being fixed in #34303
cead22 commentedon Jan 23, 2024
Yeah