Skip to content

Commit

Permalink
fix(next): fix FormItem styles (#1916)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored Jul 31, 2021
1 parent f5fa145 commit 9850f76
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/next/src/__builtins__/mapStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const mapStatus = (props: any, field: GeneralField) => {
if (field['loading'] || field?.['validating']) return 'loading'
if (field['invalid']) return 'error'
if (field['warnings']?.length) return 'warning'
return field.decoratorProps?.feedbackStatus
}
return {
...props,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/form-item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export const BaseItem: React.FC<IFormItemProps> = (props) => {
[`${prefix}-focus`]: active,
})}
>
<FormLayoutShallowContext.Provider value={undefined}>
<FormLayoutShallowContext.Provider value={{ size }}>
{formatChildren}
</FormLayoutShallowContext.Provider>
{feedbackIcon && (
Expand Down
14 changes: 14 additions & 0 deletions packages/next/src/form-item/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@
border: none !important;
box-shadow: none !important;
outline: none;

.#{$css-prefix}input-control {
margin-right: 0;
padding-right: 0;
.#{$css-prefix}icon {
display: none;
}

.#{$css-prefix}input-hint-wrap {
.#{$css-prefix}icon {
display: block;
}
}
}
}
}
}
Expand Down

0 comments on commit 9850f76

Please sign in to comment.