PerfectMemory / ngx-contextmenu

A context menu component for Angular
https://perfectmemory.github.io/ngx-contextmenu
MIT License
42 stars 12 forks source link

Problem With passive="true": string not assignable to boolean #25

Closed bcwhite-code closed 1 year ago

bcwhite-code commented 1 year ago

@perfectmemory/ngx-contextmenu: ^15.1.1 typescript: ~4.9.4

I'm using Angular 15 and was just starting to make a menu following the examples:

<context-menu #nodeContextMenu>
    <ng-template contextMenuItem passive="true">
        <span class="menu-item-title">Node Actions</span>
    </ng-template>
    <ng-template contextMenuItem (execute)="false;">nothing</ng-template>
</context-menu>

This breaks the Angular build with the error:

error TS2322: Type 'string' is not assignable to type 'boolean'.
<ng-template contextMenuItem passive="true">
                             ~~~~~~~

I tried passive=true (same error), passive="1" (same error), [passive]="true" (no error but doesn't seem to work, either).

sroucheray commented 1 year ago

Hi @bcwhite-code,

As you can see here, it is a really standard input, nothing fancy, so maybe there is a problem in the setup of your project. Could you provide a stackblitz with a minimum viable reproduction of your problem please ?

bcwhite-code commented 1 year ago

Hmmm... Okay. Thanks for the info. In the end, it didn't provide the interface I wanted (which was do a select while holding right-button down) so I ended up writing my own.