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: Error Icon not showing up on errored input fieds on validation #15431

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { styled, css, SupersetTheme } from '@superset-ui/core';
import InfoTooltip from 'src/components/InfoTooltip';
import FormItem from './FormItem';
import FormLabel from './FormLabel';

import errorIcon from 'images/icons/error.svg'
export interface LabeledErrorBoundInputProps {
label?: string;
validationMethods:
Expand All @@ -49,18 +49,17 @@ const alertIconStyles = (theme: SupersetTheme, hasError: boolean) => css`
${hasError &&
`.ant-form-item-control-input-content {
position: relative;

&:after {
content: ' ';
display: inline-block;
background: ${theme.colors.error.base};
mask: url('/images/icons/error.svg');
mask: url(${errorIcon});
mask-size: cover;
width: ${theme.gridUnit * 4}px;
height: ${theme.gridUnit * 4}px;
position: absolute;
right: 7px;
top: 15px;
right: 2%;
Copy link
Member

Choose a reason for hiding this comment

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

Could you change right and top to have static values with px instead of %? The field size shouldn't be changing so a static value should be fine here. Could you also change the value to use theme.gridUnit? Each gridUnit is 4, so if you wanted a value of 16px you'd do ${theme.gridUnit * 4}px

top: 26%;
}
}`}
`;
Expand Down