From cc76f01948b1b03f04e577231e95350b5d85e525 Mon Sep 17 00:00:00 2001 From: Carlos Quiroz Date: Wed, 18 Dec 2024 19:59:15 -0300 Subject: [PATCH 1/2] Add option of a text change callback --- .../lucuma/ui/primereact/FormInputTextAreaView.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/ui/src/main/scala/lucuma/ui/primereact/FormInputTextAreaView.scala b/modules/ui/src/main/scala/lucuma/ui/primereact/FormInputTextAreaView.scala index a7ceb80f5..c63ebf45e 100644 --- a/modules/ui/src/main/scala/lucuma/ui/primereact/FormInputTextAreaView.scala +++ b/modules/ui/src/main/scala/lucuma/ui/primereact/FormInputTextAreaView.scala @@ -27,6 +27,7 @@ final case class FormInputTextAreaView[V[_]]( autoResize: js.UndefOr[Boolean] = js.undefined, tooltip: js.UndefOr[VdomNode] = js.undefined, tooltipPlacement: floatingui.Placement = floatingui.Placement.Top, + onTextChange: String => Callback = _ => Callback.empty, modifiers: Seq[TagMod] = Seq.empty )(using val vl: ViewLike[V]) extends ReactFnProps(FormInputTextAreaView.component): @@ -42,10 +43,13 @@ object FormInputTextAreaView: private type Props[V[_]] = FormInputTextAreaView[V] - private def onChange[V[_]](valueView: View[String]): ReactEventFromTextArea => Callback = + private def onChange[V[_]]( + valueView: View[String], + onTextChange: String => Callback + ): ReactEventFromTextArea => Callback = (e: ReactEventFromTextArea) => { val v = e.target.value - valueView.set(v) + valueView.set(v) *> onTextChange(v) } private def onBlur[V[_]](props: Props[V], valueView: View[String]): Callback = @@ -68,7 +72,7 @@ object FormInputTextAreaView: props.tooltipPlacement, props.modifiers )( - ^.onChange ==> onChange[V](valueView), + ^.onChange ==> onChange[V](valueView, props.onTextChange), ^.onBlur --> onBlur(props, valueView) ) ) From 92c6872ee9d3db4c8c32af87b8ae32fb3caf48ba Mon Sep 17 00:00:00 2001 From: Carlos Quiroz Date: Wed, 18 Dec 2024 20:25:02 -0300 Subject: [PATCH 2/2] Update binary version --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 43b6f70a2..5676c56ca 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ import org.scalajs.linker.interface.ModuleSplitStyle -ThisBuild / tlBaseVersion := "0.124" +ThisBuild / tlBaseVersion := "0.125" ThisBuild / tlCiReleaseBranches := Seq("master") val Versions = new {