sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

using href="#" prevents onclick when in a Teams app

Open MagtheRag opened this issue 3 years ago • 3 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

macOS

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [X] 💥 Microsoft Edge
  • [X] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [X] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

We have an app that is both a personal app and included as a Teams tab. The app itselfs "lives" in SharePoint and is included through the TeamsLogon page. In both places we have experienced that everywhere where we have an anchor tag with the href="#" the onclick events have stopped working. It works if we open the app directly in SharePoint and also if we iframe the app through an embed webpart in sharepoint. This solution has this issue in many places and environments.

Steps to reproduce

  1. Open desktop client or Teams in the browser
  2. Open an app with links href="#" and an onlick event attached
  3. The onclick event will not fire

Expected behavior

The onlick event should fire

MagtheRag avatar Jan 24 '23 07:01 MagtheRag

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jan 24 '23 07:01 ghost

Dupe of #8647

AJIXuMuK avatar Jan 24 '23 18:01 AJIXuMuK

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

ghost avatar Feb 01 '23 12:02 ghost