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 src/input/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clear-trigger | String | always | show clear icon, clicked to clear input value
clearable | Boolean / Object | false | show clear icon, clicked to clear input value | N
confirm-hold | Boolean | false | \- | N
confirm-type | String | done | options: send/search/next/go/done | N
cursor | Number | - | required | Y
cursor | Number | -1 | required | Y
cursor-color | String | #0052d9 | \- | N
cursor-spacing | Number | 0 | \- | N
disabled | Boolean | undefined | make input to be disabled | N
Expand Down
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 @@ clear-trigger | String | always | 清空图标触发方式,仅在输入框有
clearable | Boolean / Object | false | 是否可清空,默认不启动。值为 `true` 表示使用默认清空按钮,值为 `Object` 表示透传至 `icon` | N
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 | Number | -1 | 必需。指定 focus 时的光标位置 | Y
cursor-color | String | #0052d9 | 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 | N
cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N
disabled | Boolean | undefined | 是否禁用输入框 | N
Expand Down
4 changes: 2 additions & 2 deletions src/input/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports[`input props : clearable && label && suffix 1`] = `
class="t-input__control t-input--left t-class-input"
confirmHold="{{false}}"
confirmType="done"
cursor="{{0}}"
cursor="{{-1}}"
cursorColor="#0052d9"
cursorSpacing="{{0}}"
disabled="{{null}}"
Expand Down Expand Up @@ -171,7 +171,7 @@ exports[`input slots : label 1`] = `
class="t-input__control t-input--left t-class-input"
confirmHold="{{false}}"
confirmType="done"
cursor="{{0}}"
cursor="{{-1}}"
cursorColor="#0052d9"
cursorSpacing="{{0}}"
disabled="{{null}}"
Expand Down
1 change: 1 addition & 0 deletions src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const props: TdInputProps = {
/** 指定 focus 时的光标位置 */
cursor: {
type: Number,
value: -1,
required: true,
},
/** 光标颜色。iOS 下的格式为十六进制颜色值 #000000,安卓下的只支持 default 和 green,Skyline 下无限制 */
Expand Down
1 change: 1 addition & 0 deletions src/input/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface TdInputProps {
};
/**
* 指定 focus 时的光标位置
* @default -1
*/
cursor: {
type: NumberConstructor;
Expand Down
2 changes: 1 addition & 1 deletion src/search/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ clear-trigger | String | always | show clear icon, clicked to clear input value
clearable | Boolean | true | \- | N
confirm-hold | Boolean | false | \- | N
confirm-type | String | search | options: send/search/next/go/done | N
cursor | Number | - | required | Y
cursor | Number | -1 | required | Y
cursor-spacing | Number | 0 | \- | N
disabled | Boolean | false | \- | N
focus | Boolean | false | \- | N
Expand Down
2 changes: 1 addition & 1 deletion src/search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ clear-trigger | String | always | 清空图标触发方式,仅在输入框有
clearable | Boolean | true | 是否启用清除控件 | N
confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N
confirm-type | String | search | 设置键盘右下角按钮的文字,仅在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 | Number | -1 | 必需。指定 focus 时的光标位置 | Y
cursor-spacing | Number | 0 | 搜索框聚焦时底部与键盘的距离 | N
disabled | Boolean | false | 是否禁用 | N
focus | Boolean | false | 是否聚焦 | N
Expand Down
2 changes: 1 addition & 1 deletion src/search/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`search Props :base 1`] = `
class="t-input__keyword t-class-input "
confirmHold="{{false}}"
confirmType="search"
cursor="{{0}}"
cursor="{{-1}}"
cursorSpacing="{{0}}"
disabled="{{null}}"
focus="{{false}}"
Expand Down
1 change: 1 addition & 0 deletions src/search/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const props: TdSearchProps = {
/** 指定 focus 时的光标位置 */
cursor: {
type: Number,
value: -1,
required: true,
},
/** 搜索框聚焦时底部与键盘的距离 */
Expand Down
1 change: 1 addition & 0 deletions src/search/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface TdSearchProps {
};
/**
* 指定 focus 时的光标位置
* @default -1
*/
cursor: {
type: NumberConstructor;
Expand Down