fix toast display and auto-dismiss
- Wrap toast message in span for proper text rendering - Use setTimeout instead of mosis.timer for auto-dismiss - Remove unsupported CSS animation property - Add explicit color to toast variants - Change px to dp units for RmlUi compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -227,14 +227,13 @@ function showToast(message, type)
|
||||
class = "toast toast-warning"
|
||||
end
|
||||
|
||||
-- Add toast element
|
||||
local toast_html = '<div class="' .. class .. '">' .. message .. '</div>'
|
||||
container.inner_rml = container.inner_rml .. toast_html
|
||||
-- Clear existing toasts and add new one
|
||||
local toast_html = '<div class="' .. class .. '"><span>' .. message .. '</span></div>'
|
||||
container.inner_rml = toast_html
|
||||
|
||||
-- Auto-remove after 3 seconds (would need timer API)
|
||||
if mosis and mosis.timer then
|
||||
mosis.timer.setTimeout(function()
|
||||
-- Remove first toast
|
||||
-- Auto-remove after 3 seconds
|
||||
if setTimeout then
|
||||
setTimeout(function()
|
||||
container.inner_rml = ""
|
||||
end, 3000)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user