diff --git a/docs/balloon/demo/triggerType.md b/docs/balloon/demo/triggerType.md index 46a2511ff6..9027ed6880 100644 --- a/docs/balloon/demo/triggerType.md +++ b/docs/balloon/demo/triggerType.md @@ -16,7 +16,7 @@ Hover, focus and click. --- ````jsx -import { Button, Balloon } from '@alifd/next'; +import { Button, Balloon, Input } from '@alifd/next'; const content = (

content

); @@ -24,6 +24,10 @@ const MoveTarget = ; const ClickTarget = ; const FocusTarget = ; +const HoverInputTarget = ; +const ClickInputTarget = ; +const FocusInputTarget = ; + const App = () => (
@@ -37,6 +41,19 @@ const App = () => ( {content} + +
+
+ + + {content} + + + {content} + + + {content} +
); diff --git a/src/balloon/balloon.jsx b/src/balloon/balloon.jsx index 8c744490e0..c833ffc340 100644 --- a/src/balloon/balloon.jsx +++ b/src/balloon/balloon.jsx @@ -368,7 +368,7 @@ export default class Balloon extends React.Component { needAdjust={needAdjust} animation={animation} delay={delay} - autoFocus={autoFocus} + autoFocus={triggerType === 'focus' ? false : autoFocus} safeNode={safeNode} container={popupContainer || container} className={popupClassName} diff --git a/src/balloon/tooltip.jsx b/src/balloon/tooltip.jsx index c5d7db85c0..9c843aa48f 100644 --- a/src/balloon/tooltip.jsx +++ b/src/balloon/tooltip.jsx @@ -99,6 +99,7 @@ export default class Tooltip extends React.Component { popupClassName, popupStyle, triggerType, + autoFocus, rtl, ...others } = this.props; @@ -163,6 +164,7 @@ export default class Tooltip extends React.Component { className={popupClassName} style={popupStyle} rtl={rtl} + autoFocus={triggerType === 'focus' ? false : autoFocus} shouldUpdatePosition {...popupProps} >