Skip to content

Commit

Permalink
demonstrate max_lines; minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Aug 6, 2021
1 parent 7cd0ba6 commit 090295f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def button_increment():
with example(ui.log):
from datetime import datetime

log = ui.log().classes('h-16')
log = ui.log(max_lines=10).classes('h-16')
ui.button('Log time', on_click=lambda: log.push(datetime.now().strftime("%X.%f")[:-5]))

with example(ui.joystick):
Expand Down
2 changes: 1 addition & 1 deletion nicegui/elements/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Vue.component("log", {
},
methods: {
push(line) {
const decoded = decodeURI(line);
const decoded = decodeURIComponent(line);
const textarea = document.getElementById(this.$props.jp_props.id);
textarea.innerHTML += (num_lines ? "\n" : "") + decoded;
textarea.scrollTop = textarea.scrollHeight;
Expand Down
2 changes: 1 addition & 1 deletion nicegui/elements/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, max_lines: int = None):

super().__init__(LogView(max_lines=max_lines))

self.classes('border whitespace-pre font-mono').style('opacity: 1 !important')
self.classes('border whitespace-pre font-mono').style('opacity: 1 !important; cursor: text !important')

async def push_async(self, line: str):

Expand Down

0 comments on commit 090295f

Please sign in to comment.