Skip to content

Conversation

@comhar
Copy link
Contributor

@comhar comhar commented Apr 4, 2025


name: Pull Request
about: Propose changes to the codebase
title: '[PR] '
labels: ''
assignees: ''


Related Issue
#703

I think the underlying issue is that we're attempting to do an oob swap before the target element (toast container) has been inserted into the DOM.

Proposed Changes
This pr updates toaster.py so that toasts are inserted at the top of the page.

Types of changes
What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist
Go over all the following points, and put an x in all the boxes that apply:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I am aware that this is an nbdev project, and I have edited, cleaned, and synced the source notebooks instead of editing .py or .md files directly.

Additional Information
Here's a demo of bug and solution

toasts.mp4

@gitnotebooks
Copy link

gitnotebooks bot commented Apr 4, 2025

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/704

@comhar comhar changed the title fix toasts so that it inserts toasts at top of page inserts toasts at top of the page Apr 4, 2025
@comhar comhar self-assigned this Apr 4, 2025
@comhar comhar added the bug Something isn't working label Apr 4, 2025
@comhar comhar requested review from curtis-allan and jph00 April 4, 2025 17:59
@jph00
Copy link
Contributor

jph00 commented Apr 5, 2025

Thank you! :)

@jph00 jph00 merged commit e82a7d4 into main Apr 5, 2025
2 checks passed
@jph00 jph00 deleted the fix-toast-insertion branch April 5, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants