Skip to content

Commit

Permalink
获得焦点事件改到onMouseDown (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: puchunjie <[email protected]>
  • Loading branch information
puchunjie and puchunjie authored May 5, 2022
1 parent b3aa87a commit dd6e244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BaseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const BaseInput: FC<BaseInputProps> = (props) => {

const containerRef = useRef<HTMLSpanElement>(null);

const onInputMouseUp: React.MouseEventHandler = (e) => {
const onInputMouseDown: React.MouseEventHandler = (e) => {
if (containerRef.current?.contains(e.target as Element)) {
triggerFocus?.();
}
Expand Down Expand Up @@ -98,7 +98,7 @@ const BaseInput: FC<BaseInputProps> = (props) => {
className={affixWrapperCls}
style={style}
hidden={!hasAddon(props) && hidden}
onMouseUp={onInputMouseUp}
onMouseDown={onInputMouseDown}
ref={containerRef}
>
{prefix && <span className={`${prefixCls}-prefix`}>{prefix}</span>}
Expand Down

0 comments on commit dd6e244

Please sign in to comment.