FIX: tag chooser input was navigating to tag pgaes on some mobile browsers

This commit is contained in:
Neil Lalonde
2016-12-21 12:01:53 -05:00
parent 44ddc113e7
commit b5cc6851cf
3 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import renderTag from 'discourse/lib/render-tag'; import renderTag from 'discourse/lib/render-tag';
function formatTag(t) { function formatTag(t) {
return renderTag(t.id, {count: t.count}); return renderTag(t.id, {count: t.count, noHref: true});
} }
export default Ember.TextField.extend({ export default Ember.TextField.extend({
@ -96,7 +96,7 @@ export default Ember.TextField.extend({
list.push(item); list.push(item);
}, },
formatSelection(data) { formatSelection(data) {
return data ? renderTag(this.text(data)) : undefined; return data ? renderTag(this.text(data), {noHref: true}) : undefined;
}, },
formatSelectionCssClass() { formatSelectionCssClass() {
return "discourse-tag-select2"; return "discourse-tag-select2";

View File

@ -5,7 +5,7 @@ export default function renderTag(tag, params) {
tag = Handlebars.Utils.escapeExpression(tag); tag = Handlebars.Utils.escapeExpression(tag);
const classes = ['tag-' + tag, 'discourse-tag']; const classes = ['tag-' + tag, 'discourse-tag'];
const tagName = params.tagName || "a"; const tagName = params.tagName || "a";
const href = tagName === "a" ? " href='" + Discourse.getURL("/tags/" + tag) + "' " : ""; const href = (tagName === "a" && !params.noHref) ? " href='" + Discourse.getURL("/tags/" + tag) + "' " : "";
if (Discourse.SiteSettings.tag_style || params.style) { if (Discourse.SiteSettings.tag_style || params.style) {
classes.push(params.style || Discourse.SiteSettings.tag_style); classes.push(params.style || Discourse.SiteSettings.tag_style);

View File

@ -32,6 +32,7 @@
{{plugin-outlet name="edit-topic" args=(hash model=model buffered=buffered)}} {{plugin-outlet name="edit-topic" args=(hash model=model buffered=buffered)}}
<br>
{{d-button action="finishedEditingTopic" class="btn-primary btn-small submit-edit" icon="check"}} {{d-button action="finishedEditingTopic" class="btn-primary btn-small submit-edit" icon="check"}}
{{d-button action="cancelEditingTopic" class="btn-small cancel-edit" icon="times"}} {{d-button action="cancelEditingTopic" class="btn-small cancel-edit" icon="times"}}
{{else}} {{else}}