跳到主要内容

bn.getSelectedTextRange

getSelectedTextRange(): Promise<KeyboardGetSelectedTextRangeResponse>

description Obtains the cursor position of the input box after the focus of input, textarea, etc. Note: This API works only when it is called during the focus process

example

bn
.getSelectedTextRange()
.then(res => {
console.log('getSelectedTextRange res', res.start, res.end)
})
.catch(error => {
console.log('hideKeyboard error', error)
})

Returns

Promise<KeyboardGetSelectedTextRangeResponse>

KeyboardGetSelectedTextRangeResponse

Ƭ KeyboardGetSelectedTextRangeResponse: Object

Type declaration

NameType
startnumber
endnumber