This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/components/d-editor.hbs
Sam 918a0ea3a4 FIX: use autocomplete="discourse" to disable Chrome address autofill
https://stackoverflow.com/a/47822599/17174

Chrome 63 and up start ignoring `autofill="off"`

Per: https://bugs.chromium.org/p/chromium/issues/detail?id=468153#c164

> The tricky part here is that somewhere along the journey of the web autocomplete=off become a default for many form fields, without any real thought being given as to whether or not that was good for users. This doesn't mean there aren't very valid cases where you don't want the browser autofilling data (e.g. on CRM systems), but by and large, we see those as the minority cases. And as a result, we started ignoring autocomplete=off for Chrome Autofill data

So to work around this decision we now explicitly say: autocomplete="discourse"
when we don't want Chrome to randomly fill in addressed (aka. always)
2019-02-20 10:15:59 +11:00

54 lines
1.9 KiB
Handlebars

<div class='d-editor-overlay hidden'></div>
<div class='d-editor-modals'>
{{#d-editor-modal class="insert-link" hidden=insertLinkHidden okAction=(action "insertLink")}}
<h3>{{i18n "composer.link_dialog_title"}}</h3>
{{text-field value=linkUrl placeholderKey="composer.link_url_placeholder" class="link-url"}}
{{text-field value=linkText placeholderKey="composer.link_optional_text" class="link-text"}}
{{/d-editor-modal}}
</div>
<div class='d-editor-container'>
<div class="d-editor-textarea-wrapper {{if disabled "disabled"}}">
<div class='d-editor-button-bar'>
{{#each toolbar.groups as |group|}}
{{#each group.buttons as |b|}}
{{#if b.popupMenu}}
{{toolbar-popup-menu-options
onSelect=onPopupMenuAction
onExpand=(action b.action b)
title=b.title
headerIcon=b.icon
class=b.className
content=popupMenuOptions}}
{{else}}
{{d-button
action=b.action
actionParam=b
translatedTitle=b.title
label=b.label
icon=b.icon
class=b.className}}
{{/if}}
{{/each}}
{{#unless group.lastGroup}}
<div class='d-editor-spacer'></div>
{{/unless}}
{{/each}}
</div>
{{conditional-loading-spinner condition=loading}}
{{textarea autocomplete="discourse" tabindex=tabindex value=value class="d-editor-input" placeholder=placeholderTranslated disabled=disabled}}
{{popup-input-tip validation=validation}}
{{plugin-outlet name="after-d-editor" tagName="" args=outletArgs}}
</div>
<div class="d-editor-preview-wrapper {{if forcePreview 'force-preview'}}">
<div class="d-editor-preview">{{{preview}}}</div>
{{plugin-outlet name="editor-preview" classNames="d-editor-plugin"}}
</div>
</div>
{{emoji-picker active=emojiPickerIsActive emojiSelected=(action 'emojiSelected')}}