Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Fix: Disable clicking on the exclamation mark icon in ParserTreeSelect (#21695)

balibabu5ea726aad6aa
diff --git a/web/src/components/parser-tree-select/index.test.tsx b/web/src/components/parser-tree-select/index.test.tsx
index dcdce220b2..7ccc136d7f 100644
--- a/web/src/components/parser-tree-select/index.test.tsx
+++ b/web/src/components/parser-tree-select/index.test.tsx
@@ -249,6 +249,20 @@ describe('ParserTreeSelect', () => {
expect(mockTreeProps.trailingAddon).toBeUndefined();
});
+ it('renders the outdated icon as a non-submit button inside forms', () => {
+ render(
+ <ParserTreeSelect
+ value="pipeline:pipe-1:v1"
+ onChange={jest.fn()}
+ outdated
+ />,
+ );
+ // The tooltip trigger renders a raw <button>; without an explicit
+ // type="button" it defaults to submit and clicking the icon would submit
+ // the surrounding form (dataset settings, document pipeline dialog).
+ expect(mockTreeProps.trailingAddon.props.type).toBe('button');
+ });
+
it('flags the trigger border only while the owning field is invalid', () => {
const { rerender } = render(
<ParserTreeSelect
diff --git a/web/src/components/parser-tree-select/index.tsx b/web/src/components/parser-tree-select/index.tsx
index 2978a98c0a..eefe7e5a87 100644
--- a/web/src/components/parser-tree-select/index.tsx
+++ b/web/src/components/parser-tree-select/index.tsx
@@ -116,11 +116,15 @@ export function ParserTreeSelect({
[t],
);
- // The outdated icon is a pure hint: the tooltip trigger swallows its own
- // click before it bubbles to the TreeSelect trigger, so clicking the icon
- // neither toggles the dropdown nor triggers the lazy version fetches that
- // follow. It is hidden while the value is already reported as missing — a
- // deleted pin is the stronger signal.
+ // The outdated icon is a pure hint. The Radix tooltip trigger renders a
+ // raw <button> with no `type`, which inside the surrounding forms (dataset
+ // settings, document pipeline dialog) defaults to type="submit" — clicking
+ // the icon would submit the form, and stopPropagation alone cannot cancel
+ // that native default action. type="button" removes it, while the click
+ // handlers still swallow the event before it bubbles to the TreeSelect
+ // trigger, so the click neither toggles the dropdown nor triggers the lazy
+ // version fetches that follow. It is hidden while the value is already
+ // reported as missing — a deleted pin is the stronger signal.
const stopHintClick = useCallback((e: React.SyntheticEvent) => {
e.stopPropagation();
}, []);
@@ -129,10 +133,11 @@ export function ParserTreeSelect({
outdated && (loading || selectedLeafExists) ? (
<RAGFlowTooltip
tooltip={t('flow.version.outdated')}
+ type="button"
onClick={stopHintClick}
onPointerDown={stopHintClick}
>
- <AlertCircle className="size-4 flex-shrink-0" />
+ <AlertCircle className="size-4 flex-shrink-0 text-state-warning" />
</RAGFlowTooltip>
) : undefined;