Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

Safari users could not create or select categories—the dropdown closed immediately on any interaction. The issue also affected the emoji picker.

Root Cause

Click events from interactive elements inside the dropdown bubbled to the document-level "click outside" handler, closing the dropdown prematurely. Safari's stricter event handling made this more apparent than in Chrome/Firefox.

Changes

Event Propagation

  • Added event.stopPropagation() to all interactive handlers (toggleDropdown, toggleEmojiPicker, custom_category, handleEmojiSelect)
  • Applied on:click|stopPropagation to dropdown containers, input fields, category buttons, and emoji picker

HTML Semantics

  • Changed dropdown trigger from <div role="button"> to <button type="button"> for proper Safari compatibility
  • Added ARIA attributes (aria-expanded, aria-haspopup) for accessibility

Keyboard Handling

  • Added handleInputKeydown() to prevent Enter key from triggering form submissions or closing the dropdown

Type Safety

  • Updated event handler signatures from generic Event to specific MouseEvent/KeyboardEvent types
// Before
function toggleDropdown() {
    isOpen = !isOpen;
}

// After
function toggleDropdown(event: MouseEvent) {
    event.stopPropagation();
    isOpen = !isOpen;
}

File modified: frontend/src/lib/components/CategoryDropdown.svelte

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • flagcdn.com
    • Triggering command: python manage.py download-countries (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] Cannot create or use categories when using Safari (new location window)</issue_title>
<issue_description>Describe the bug
Cannot create a new category, or use any of the existing categories, when using the Safari Browser.

To Reproduce
Steps to reproduce the behavior (USING SAFARI):

  1. Create new location
  2. Go to the second tab
  3. Try to create a category, or use one that is already created.
  4. Nothing happen, the category pop-up juste closes, category not selected nor created.

Expected behavior
Creating and using categories

Additional context
Version 18.6 (20621.3.11.11.3), tested with two different computers. Also, the emoji pop-up is not working. I think this pop-up is broken under safari.

Everything is working great with Firefox. </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Oct 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
adventurelog Ready Ready Preview Comment Oct 30, 2025 3:57pm

Copilot AI changed the title [WIP] Fix category creation and usage in Safari browser Fix Safari category dropdown closing on interaction due to event propagation Oct 30, 2025
Copilot finished work on behalf of seanmorley15 October 30, 2025 15:59
Copilot AI requested a review from seanmorley15 October 30, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants