Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix suggestion of utilities with slashes in them in v4
All utilities implicitly have at least `modifiers: []` in the class list when no modifiers are present. We should only change the completion list when there are actually modifiers to show in case an existing utility with a slash in it (e.g. `w-1/2`) is “close” to what the user has typed.
  • Loading branch information
thecrypticace committed Feb 7, 2025
commit 36c59413fb4c6e65db41bab75522b966699bc024
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@ export function completionsFromClassList(
let beforeSlash = partialClassName.split('/').slice(0, -1).join('/')

let baseClassName = beforeSlash.slice(offset)
modifiers = state.classList.find((cls) => Array.isArray(cls) && cls[0] === baseClassName)?.[1]
?.modifiers
modifiers =
state.classList.find((cls) => Array.isArray(cls) && cls[0] === baseClassName)?.[1]
?.modifiers ?? []

if (modifiers) {
if (modifiers.length > 0) {
return withDefaults(
{
isIncomplete: false,
Expand Down