using href="#" prevents onclick when in a Teams app
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
- Open desktop client or Teams in the browser
- Open an app with links href="#" and an onlick event attached
- The onclick event will not fire
Expected behavior
The onlick event should fire
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Dupe of #8647
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