Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"docs:build": "dumi build",
"docs:deploy": "gh-pages -d .doc",
"compile": "father build && lessc assets/index.less assets/index.css",
"prepublishOnly": "npm run compile && np --yolo --no-publish",
"prepublishOnly": "npm run compile && np --yolo --no-publish --branch 2.9.x",
"postpublish": "npm run gh-pages",
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
Expand Down
8 changes: 6 additions & 2 deletions src/Rate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import type { StarProps } from './Star';

function noop() {}

export interface RateProps extends Pick<StarProps, "count" | "character" | "characterRender" | "allowHalf" | "disabled"> {
export interface RateProps
extends Pick<StarProps, 'count' | 'character' | 'characterRender' | 'allowHalf' | 'disabled'> {
value?: number;
defaultValue?: number;
allowClear?: boolean;
Expand All @@ -17,6 +18,7 @@ export interface RateProps extends Pick<StarProps, "count" | "character" | "char
onChange?: (value: number) => void;
onHoverChange?: (value: number) => void;
className?: string;
id?: string;
tabIndex?: number;
onFocus?: () => void;
onBlur?: () => void;
Expand Down Expand Up @@ -131,7 +133,7 @@ class Rate extends React.Component<RateProps, RateState> {
}
};

onKeyDown: React.KeyboardEventHandler<HTMLUListElement> = event => {
onKeyDown: React.KeyboardEventHandler<HTMLUListElement> = (event) => {
const { keyCode } = event;
const { count, allowHalf, onKeyDown, direction } = this.props;
const reverse = direction === 'rtl';
Expand Down Expand Up @@ -242,6 +244,7 @@ class Rate extends React.Component<RateProps, RateState> {
count,
allowHalf,
style,
id,
prefixCls,
disabled,
className,
Expand Down Expand Up @@ -279,6 +282,7 @@ class Rate extends React.Component<RateProps, RateState> {
<ul
className={rateClassName}
style={style}
id={id}
onMouseLeave={disabled ? null : this.onMouseLeave}
tabIndex={disabled ? -1 : tabIndex}
onFocus={disabled ? null : this.onFocus}
Expand Down