-
-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add native input DOM to follow standard behavior of HTML
- Loading branch information
Showing
23 changed files
with
457 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import classNames from 'classnames'; | ||
import React from 'react'; | ||
|
||
interface SelectNativeInputProps extends React.InputHTMLAttributes<HTMLInputElement> { | ||
prefixCls?: string; | ||
} | ||
|
||
export default React.forwardRef<HTMLInputElement, SelectNativeInputProps>( | ||
function SelectNativeInput(props, ref) { | ||
const { prefixCls, className, ...rest } = props; | ||
|
||
return ( | ||
<input | ||
aria-hidden | ||
tabIndex={-1} | ||
type="hidden" | ||
readOnly | ||
ref={ref} | ||
className={classNames(`${prefixCls}-native-input`, className)} | ||
{...rest} | ||
/> | ||
); | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.