在内部单击后如何禁用关闭扩展材料的mde弹出窗口

时间:2018-06-27 10:52:57

标签: material-ui angular6

我正在通过导入扩展的mde popopver使用的弹出窗口上添加一个聊天机器人。但是,当我尝试聊天或单击弹出窗口时,弹出窗口是关闭的,是否有任何真/假触发器,以防止在单击弹出窗口后关闭弹出窗口?任何帮助表示赞赏。我想用打字稿而不是JavaScript来实现。

这就是说xyz.component.html This is what i have done so far. I am not able to chat here in this window as the popover window closes , immediately once I click on it

  <button class="mdc-fab app-fab--absolute"  
     [mdePopoverTriggerFor]="appPopover"
      mdePopoverTriggerOn="click" aria-label="Favorite" mat-fab ><mat-icon>
     <span class="mdc-fab__icon material-icons">textsms</span> 
  </mat-icon></button>   

  <mde-popover #appPopover="mdePopover" [mdePopoverOverlapTrigger]="false"> 
       Hi this is the chatbot. 
  </mde-popover>  

1 个答案:

答案 0 :(得分:2)

我想出了办法,只需添加[mdePopoverCloseOnClick] =“ false”即可禁用关闭点击。如下图所示

<button class="mdc-fab app-fab--absolute"  
 [mdePopoverTriggerFor]="appPopover"
  mdePopoverTriggerOn="click" aria-label="Favorite" mat-fab ><mat-icon>
 <span class="mdc-fab__icon material-icons">textsms</span> 
</mat-icon></button>   

<mde-popover #appPopover="mdePopover" [mdePopoverCloseOnClick]="false"  [mdePopoverOverlapTrigger]="false"> 
   Hi this is the chatbot. 
</mde-popover>  

这是更多属性的链接 https://stackblitz.com/edit/angular-material-extended-mde-popover?file=app%2Fapp.component.html