Skip to content

Commit

Permalink
Add onTextLayout to OutlinedRichTextEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
Wavesonics committed Jan 25, 2024
1 parent 2d6fd78 commit 49bebae
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.ui.layout.*
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
Expand Down Expand Up @@ -79,6 +80,7 @@ import kotlin.math.roundToInt
* that 1 <= [minLines] <= [maxLines]. This parameter is ignored when [singleLine] is true.
* @param maxLength the maximum length of the text field. If the text is longer than this value,
* it will be ignored. The default value of this parameter is [Int.MAX_VALUE].
* onTextLayout
* @param interactionSource the [MutableInteractionSource] representing the stream of [Interaction]s
* for this text field. You can create and pass in your own `remember`ed instance to observe
* [Interaction]s and customize the appearance / behavior of this text field in different states.
Expand Down Expand Up @@ -107,6 +109,7 @@ fun OutlinedRichTextEditor(
maxLines: Int = Int.MAX_VALUE,
minLines: Int = 1,
maxLength: Int = Int.MAX_VALUE,
onTextLayout: (TextLayoutResult) -> Unit = {},
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = RichTextEditorDefaults.outlinedShape,
colors: RichTextEditorColors = RichTextEditorDefaults.outlinedRichTextEditorColors(),
Expand Down Expand Up @@ -146,6 +149,7 @@ fun OutlinedRichTextEditor(
maxLines = maxLines,
minLines = minLines,
maxLength = maxLength,
onTextLayout = onTextLayout,
decorationBox = { innerTextField ->
RichTextEditorDefaults.OutlinedRichTextEditorDecorationBox(
value = state.textFieldValue.text,
Expand Down

0 comments on commit 49bebae

Please sign in to comment.