Skip to content

Instantly share code, notes, and snippets.

@krukid
Last active March 3, 2020 16:18
Show Gist options
  • Save krukid/03f5193ed0724c28650ad575302c6307 to your computer and use it in GitHub Desktop.
Save krukid/03f5193ed0724c28650ad575302c6307 to your computer and use it in GitHub Desktop.
emberjs-issue-18758
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Counter-intuitive behavior for input component HTML attributes</h1>
<strong>https://github.com/emberjs/ember.js/issues/18758</strong>
<!-- test cases -->
<h3>attribute="false"</h3>
<p>
{{input
spellcheck="false"
autocomplete="false"
}}
</p>
<code></code>
<h3>attribute=false</h3>
<p>
{{input
spellcheck=false
autocomplete=false
}}
</p>
<code></code>
<h3>attribute=0</h3>
<p>
{{input
spellcheck=0
autocomplete=0
}}
</p>
<code></code>
<h3>attribute=1</h3>
<p>
{{input
spellcheck=1
autocomplete=1
}}
</p>
<code></code>
<h3>attribute="0"</h3>
<p>
{{input
spellcheck="0"
autocomplete="0"
}}
</p>
<code></code>
<h3>attribute="1"</h3>
<p>
{{input
spellcheck="1"
autocomplete="1"
}}
</p>
<code></code>
<h3>attribute=""</h3>
<p>
{{input
spellcheck=""
autocomplete=""
}}
</p>
<code></code>
<h3>attribute=" "</h3>
<p>
{{input
spellcheck=" "
autocomplete=" "
}}
</p>
<code></code>
<!-- quick compare -->
<br>
<img width="1" height="1" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3C/svg%3E" onload="
$('p').each(function() {
let _expect = null;
$(this).next('code').html(
$(this).html()
.replace(/[<>&]/g, (c) => `&#${c.charCodeAt(0)}`)
.replace(/autocomplete=(\S+)/, (a, b) => (_expect = b, a.fontcolor('green')))
.replace(/spellcheck=(\S+)/, (a, b) =>
b === _expect
? a.fontcolor('green')
: a.fontcolor('red').bold()
)
);
})
">
{
"version": "0.16.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.14.3",
"ember-template-compiler": "3.14.3",
"ember-testing": "3.14.3"
},
"addons": {
"ember-data": "3.14.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment