Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Input): set the default value of cursorColor attribute to #0052d9 #3453

Merged
merged 1 commit into from
Jan 16, 2025
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 src/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ clearable | Boolean / Object | false | 是否可清空,默认不启动。值
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
confirm-type | String | done | 设置键盘右下角按钮的文字,仅在type='text'时生效。<br />具体释义:<br />`send` 右下角按钮为“发送”;<br />`search` 右下角按钮为“搜索”;<br />`next` 右下角按钮为“下一个”;<br />`go` 右下角按钮为“前往”;<br />`done` 右下角按钮为“完成”。<br />[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N
cursor | Number | - | 必需。指定 focus 时的光标位置 | Y
cursor-color | String | - | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
cursor-color | String | #0052d9 | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N
disabled | Boolean | undefined | 是否禁用输入框 | N
error-message | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
Expand Down
4 changes: 4 additions & 0 deletions src/input/_example/base/index.wxss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.custom-label {
display: inline-flex;
}

.custom-label::after {
content: '*';
color: red;
Expand Down
3 changes: 1 addition & 2 deletions src/input/input.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SuperComponent, wxComponent } from '../common/src/index';
import config from '../common/config';
import props from './props';
import { getCharacterLength, calcIcon, isDef, isIOS } from '../common/utils';
import { getCharacterLength, calcIcon, isDef } from '../common/utils';

const { prefix } = config;
const name = `${prefix}-input`;
Expand Down Expand Up @@ -32,7 +32,6 @@ export default class Input extends SuperComponent {
classPrefix: name,
classBasePrefix: prefix,
showClearIcon: true,
defaultCursorColor: isIOS() ? '#0052d9' : 'default',
};

lifetimes = {
Expand Down
2 changes: 1 addition & 1 deletion src/input/input.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
confirm-type="{{confirmType}}"
confirm-hold="{{confirmHold}}"
cursor="{{cursor}}"
cursor-color="{{cursorColor || defaultCursorColor}}"
cursor-color="{{cursorColor}}"
cursor-spacing="{{cursorSpacing}}"
adjust-position="{{adjustPosition}}"
auto-focus="{{autoFocus}}"
Expand Down
2 changes: 1 addition & 1 deletion src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const props: TdInputProps = {
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 */
cursorColor: {
type: String,
value: '',
value: '#0052d9',
},
/** 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 */
cursorSpacing: {
Expand Down
Loading