Skip to content

fix form error style for input addonAfter slot when disabled #6403

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

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions components/form/style/mixin.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
color: @text-color;
}

.@{ant-prefix}-input-group-addon,
.@{ant-prefix}-input-number-group-addon {
:not(.@{ant-prefix}-input-group-addon-disabled).@{ant-prefix}-input-group-addon,
:not(.@{ant-prefix}-input-number-group-addon-disabled).@{ant-prefix}-input-number-group-addon {
color: @text-color;
border-color: @border-color;
}
Expand Down
11 changes: 9 additions & 2 deletions components/input/ClearableLabeledInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default defineComponent({
size,
direction,
hidden,
disabled,
} = props;
// Not wrap when there is not addons
if (!hasAddon({ addonBefore, addonAfter })) {
Expand All @@ -152,10 +153,16 @@ export default defineComponent({

const wrapperClassName = `${prefixCls}-group`;
const addonClassName = `${wrapperClassName}-addon`;
// fix form error style for input addonAfter slot when disabled
const mergedAddonClassName = classNames(addonClassName, {
[`${addonClassName}-disabled`]: disabled,
});
const addonBeforeNode = addonBefore ? (
<span class={addonClassName}>{addonBefore}</span>
<span class={mergedAddonClassName}>{addonBefore}</span>
) : null;
const addonAfterNode = addonAfter ? (
<span class={mergedAddonClassName}>{addonAfter}</span>
) : null;
const addonAfterNode = addonAfter ? <span class={addonClassName}>{addonAfter}</span> : null;

const mergedWrapperClassName = classNames(`${prefixCls}-wrapper`, wrapperClassName, {
[`${wrapperClassName}-rtl`]: direction === 'rtl',
Expand Down