Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Conversation

@joekrump
Copy link
Contributor

Fixes #102

Test steps:

Setup

  1. Set up some command line items to use.
    1. Add a command item with double quotes in its name. Ex.
    `This is a value with "double" quotes`
    
    1. Add a command item with \" in its name: Ex.
    `This the the \\"value\\"`
    
  2. Use the options in a Command instance and view it in a browser with dev tools open so you can see the console logs.

Steps

  1. Hover over the command item with the name with double quotes
  2. There are no errors logged to the console
  3. Hover over the command item with escaped double quotes in its name
  4. There are no errors logged to the console
  5. You are able to filter the command items by typing in a string containing double quotes

@changeset-bot
Copy link

changeset-bot bot commented Mar 11, 2025

🦋 Changeset detected

Latest commit: fa80ed9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
cmdk-sv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmdk-sv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 13, 2025 3:39pm

@huntabyte
Copy link
Owner

Do we even need those surrounding quotes?

Shouldn't [data-value=somevalue] work fine?

@joekrump
Copy link
Contributor Author

joekrump commented Mar 13, 2025

Hey @huntabyte

Do we even need those surrounding quotes?

Sadly it doesn't. We need the double quotes and CSS.escape

Shouldn't [data-value=somevalue] work fine?

It would appear like it should but does not. Values such as "\\"hello\\"" are an example where [data-value=somevalue]` does not work.

Here are the test cases I've been using to verify in the absense of automated tests.

image

@huntabyte huntabyte merged commit fa2406f into huntabyte:main Mar 13, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commands with a values that have double quotes (") in them result in an error

2 participants