Ahmed Moubtahij
Ahmed Moubtahij
SSolara
Created by Ahmed Moubtahij on 1/17/2025 in #questions-issues
Multiline ChatInput
solara.lab.ChatInput is great but it doesn't allow multi-line input (shift+enter to line break will just send the message). I've tried solara.InputTextArea with update_events=["keyup.enter"] instead for linebreaks to work, and they do, but now pressing "enter" just linebreaks and doesn't send the message. What should I do short of dropping down to js?
3 replies
SSolara
Created by Ahmed Moubtahij on 1/1/2025 in #questions-issues
Clearing a component
I have a solara.use_task-triggered solara.HTML(tag="iframe", ...) component. I want to clear the solara.Column hosting it from it when the user requests its deletion. I can choose to render it or not based on a boolean controlled by the user, but that's not really deleting it right? The iframe holds a resource that is, I think, still present in the DOM. How do I really clear this component? What's the advised practice?
4 replies
SSolara
Created by Ahmed Moubtahij on 9/12/2024 in #questions-issues
rendering pdf
@solara.component
def Page():
solara.use_effect(generate_pdf, dependencies=[])

with solara.Column(style={"height": "100%", "width": "100%"}):
static_pdf= f"/static/{os.path.basename(PDF_PATH)}"
solara.HTML(f'<iframe src="{static_pdf}" style="width:100%; height:100%;"></iframe>')
@solara.component
def Page():
solara.use_effect(generate_pdf, dependencies=[])

with solara.Column(style={"height": "100%", "width": "100%"}):
static_pdf= f"/static/{os.path.basename(PDF_PATH)}"
solara.HTML(f'<iframe src="{static_pdf}" style="width:100%; height:100%;"></iframe>')
I'm running this app in a docker container and exposing it through a port to the browser. Problem: the browser can't find the pdf to render. I thought I'd applied the same logic in https://solara.dev/documentation/advanced/reference/static-files but I seem to be missing something. I have verified that the pdf is correctly generated and in the right path within the container's filesystem. I suspect that there is a path inconsistency when rendering on my host machine's browser. I thought that's what the static/ logic was supposed to solve? Thank you for your time
11 replies