You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe only do this for command links? It might be useful to be able to use a link to doc even before an extension is ready to have its commands called.
I started researching this, and ran into the question of how to disable a link (HTMLAnchorElement). Found an interesting article here. In summary, setting the href attribute to "" will prevent the link from functioning, and CSS selectors can be used to display a no-href one differently from a normal one. Does that sound like the way to go?
If yes, perhaps add a boolean disabled property to ILinkStyles and have the applyStyles method of the Link class use this to swap the href in or out, stashing it in a data-href attribute before clearing it from href.
To test, create an extension that contributes a welcome view with an enablement expression and at least one command link in the contents. Verify that the link is only clickable when the expression is true. Include a regular link in the content and verify it is always clickable.
Activity
gjsjohnmurray commentedon Dec 1, 2020
Maybe only do this for command links? It might be useful to be able to use a link to doc even before an extension is ready to have its commands called.
jrieken commentedon Dec 1, 2020
Yeah, command links is what I meant
joaomoreno commentedon Dec 1, 2020
John Murray (@gjsjohnmurray) Want to submit a PR? 👍
gjsjohnmurray commentedon Dec 4, 2020
I started researching this, and ran into the question of how to disable a link (
HTMLAnchorElement). Found an interesting article here. In summary, setting thehrefattribute to "" will prevent the link from functioning, and CSS selectors can be used to display a no-href one differently from a normal one. Does that sound like the way to go?If yes, perhaps add a boolean
disabledproperty toILinkStylesand have theapplyStylesmethod of theLinkclass use this to swap thehrefin or out, stashing it in adata-hrefattribute before clearing it fromhref.What do you think?
joaomoreno commentedon Dec 4, 2020
Sounds good to me.
fix microsoft#111587 Apply enablement to command links in welcome views
gjsjohnmurray commentedon Jan 5, 2021
João Moreno (@joaomoreno) I have submitted #113841
fix #111587 Apply enablement to command links in welcome views (#113841)
joaomoreno commentedon Jan 25, 2021
Verification steps from John Murray (@gjsjohnmurray):