From 2dbe2bf4af5bcca895a2803a184d8193083e6ff1 Mon Sep 17 00:00:00 2001 From: Manshu Tusker <35138018+dadaguai-git@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:02:45 +0800 Subject: [PATCH] fix(components): [message] max affects grouping display (#18189) fix(components): [message] Fix message grouping with max limit Prioritize grouping logic over max limit in message component closed #18117 --- packages/components/message/src/method.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/components/message/src/method.ts b/packages/components/message/src/method.ts index 0403f1e802..84b6037022 100644 --- a/packages/components/message/src/method.ts +++ b/packages/components/message/src/method.ts @@ -158,10 +158,6 @@ const message: MessageFn & ) => { if (!isClient) return { close: () => undefined } - if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) { - return { close: () => undefined } - } - const normalized = normalizeOptions(options) if (normalized.grouping && instances.length) { @@ -175,6 +171,10 @@ const message: MessageFn & } } + if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) { + return { close: () => undefined } + } + const instance = createMessage(normalized, context) instances.push(instance)