Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
kostaskougios committed Jan 22, 2024
1 parent 7131227 commit e4bf1da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 4 additions & 8 deletions docs/chakra.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Text(text = "typography-text-0001", color = Some("tomato"))
```scala
val b = Button(text = "Keep Running")
b.onClick: () =>
b.text = "Clicked"
session.render()
b.withText("Clicked").renderChanges()
```

### Box
Expand Down Expand Up @@ -63,12 +62,10 @@ Menu().withChildren(
MenuList().withChildren(
MenuItem(text = "Download menu-download")
.onClick: () =>
box1.text = "'Download' clicked"
session.render()
box1.withText("'Download' clicked").renderChanges()
,
MenuItem(text = "Copy").onClick: () =>
box1.text = "'Copy' clicked"
session.render()
box1.withText("'Copy' clicked").renderChanges()
)
)
```
Expand Down Expand Up @@ -104,8 +101,7 @@ val editable1 = Editable(defaultValue = "Please type here").withChildren(
)

editable1.onChange: newValue =>
status.text = s"editable1 newValue = $newValue, verify editable1.value = ${editable1.value}"
session.render()
status.withText(s"editable1 newValue = $newValue, verify editable1.value = ${editable1.value}").renderChanges()

// Use text area for longer texts
val editable2 = Editable(defaultValue = "For longer maybe-editable texts\nUse an EditableTextarea\nIt uses a textarea control.").withChildren(
Expand Down
4 changes: 1 addition & 3 deletions docs/std.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,5 @@ Header1(text = "Welcome to the std components demo/test")
val input = Input(defaultValue = "Please enter your name")
val output = Paragraph(text = "This will reflect what you type in the input")
input.onChange: newValue =>
output.text = newValue
session.render()

output.withText(newValue).renderChanges()
```

0 comments on commit e4bf1da

Please sign in to comment.