Skip to content

Autocomplete: popover is no styled #1064

@euskadi31

Description

@euskadi31

Please provide the environment you discovered this bug in.

  • Angular 21
  • CDK 21
  • Spartan-ng ^0.0.1-alpha.569
  • tailwindcss 4.1.12

Which area/package is the issue in?

autocomplete

Description

I created a standalone component to autocomplete addresses using the Google Maps Places API with the HlmAutocomplete component. Everything works except for the dropdown/popover style, which isn't applied.

I tried importing the HlmPopoverImports component, but it didn't change anything.

Am I missing something?

Image
import {
  ChangeDetectionStrategy,
  Component,
  inject,
  input,
  output,
  resource,
  signal,
} from '@angular/core';
import {
  HlmAutocompleteImports,
  provideHlmAutocompleteConfig,
} from '@spartan-ng/helm/autocomplete';
import { HlmSpinnerImports } from '@spartan-ng/helm/spinner';
import { HlmButtonImports } from '@spartan-ng/helm/button';

@Component({
  selector: 'app-input-address',
  imports: [HlmAutocompleteImports, HlmSpinnerImports, HlmButtonImports],
  providers: [
    provideHlmAutocompleteConfig({
      transformOptionToString: (option: AutocompleteSuggestion) =>
        option.plainText,
      transformOptionToValue: (option: AutocompleteSuggestion) => option.id,
    }),
  ],
  template: `
    <hlm-autocomplete
      [filteredOptions]="options.value()"
      [loading]="options.isLoading()"
      [(search)]="search"
      [displayWith]="_displayWith"
      [debounceTime]="debounceTime()"
      (valueChange)="handleSelection($event)"
      [optionTemplate]="optionTpl"
    >
      <hlm-spinner loading class="size-6" />
    </hlm-autocomplete>
    <ng-template #optionTpl let-suggestion>
      <span [innerHTML]="suggestion.displayText"></span>
    </ng-template>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class InputAddressComponent {
// ...
}

Please provide the exception or error you saw


Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions