-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offer templates sometimes wrap weirdly #1116
Comments
I can make the iframe taller so it doesn't overlap. Oftentimes I think the desired outcome is actually something very similar to an |
These all sound like reasonable options to pass to the shell. I'd happily review patches to improve styling options for offer-templates - perhaps these all become part of a I could see some additional whitelisted styles that you could pass to the @ndarilek also mentioned that it would be convenient to have this render as a Tricky. |
Actually, I think the textarea bit is more something you'd pass as your
template, something like:
```
var template = "Use the following command to
connect:<br/><textarea>cmdline-client $API_HOST $API_TOKEN</textarea>";
```
With that set up, I could very easily copy-paste the commands, but that
isn't something I'd want done universally. I think it's what Github does
when you set up a new repo, for instance, but I'd want a link rendered
as an `<a/>` so I could tab to it, right-click and use "Copy link
location," etc. So for Gitlab I'd like to see all the copy-pastable Git
commands in a `<textarea/>` if possible, but not the entire template.
|
@ndarilek The trouble with that is that it breaks confinement. If you can specify arbitrary HTML, you can also specify an If you could put just the Similarly, a |
The catch is that I'd like for only parts to be in a textarea, not the
entire thing though as that defeats the point. I like it for things
you'd type into a command line, but not for the entire content.
Given that it isn't a super easy thing to implement, I'd be OK with
punting it for now. I also wonder if there is a battle-tested HTML
sanitization API that would let you whitelist, say, <a/> and <textarea/>
but nothing else. I'd never advocate shoving arbitrary HTML into that
field. :)
|
@ndarilek would it be possible to make the offer-template iframe only the textarea, just put your other content outside the iframe? Or are there offers-template variables that need to go outside? (one challenge is that if you add two offers-templates to a page, you get two different api keys) |
See https://github.com/sandstorm-io/sandstorm. Look below the header The URL is included in a <textarea/>. If I as a screen reader user hit tab, I can land in the field. I can If we put the entire template into a <textarea/>, we lose that ease of I think the best solution would be a whitelisted set of HTML tags, maybe Thanks. |
Hmmm. Here's an idea to solve the two-different-API-keys problem (though it involves a longer cascading chain of
This would still only work with sessionStorage, so you wouldn't be able to reuse this across sessions or for different users, but maybe this could solve the oddity in Davros where you wind up generating two distinct API tokens on the same page to connect the desktop sync client. |
@ndarilek It sound like you and @mnutt are in agreement - the textarea should only include the text that you actually want to copy. I think you can accomplish that with the addition of an option that makes the offer template render just the copyable text inside Is there an issue with tab-focus and iframes that makes it harder to tab to reach/identify a |
I don't think you'd need to do anything for the textarea. It should get
a tabindex by default. I'd also not autofocus it as it isn't likely to
be of interest every single time someone hits the grain.
|
This is what I see in davros's offer template:
To avoid this problem, maybe template embedders ought to:
Once we know what to tell them, then I can change the docs so we actually tell them that. For now, I'm not sure what to suggest so for now I just wanted to file this.
P.S. I got those API tokens a few hours ago, so presumably they are revoked.
The text was updated successfully, but these errors were encountered: