# wx.getSelectedTextRange(Object object)

Start from base library version 2.7.0. Please remaining backward compatible.

with Promise style call: Supported

Mini Program plugin: Not supported

After input, text area, and so on, get the cursor position of the input box. Note: This interface is only valid when called with focus.

# parameter

# Object object

attribute type Default values Required Introductions
success function no Interface calls the successful callback function
fail function no Interface calls failed callback functions
complete function no Callback function at the end of an interface call (both successful and unsuccessful calls are executed)

# object.success callback

# parameter
# Object res
attribute type Introductions
start number Input box cursor start position
end number Input Box Cursor End Position

# sample code

  complete: res => {
    console.log('getSelectedTextRange res', res.start, res.end)