Skip to content

Commit

Permalink
Merge pull request #227 from apinf/feature/ie-dropdown-fix
Browse files Browse the repository at this point in the history
Fix dropdown optionfields on IE
  • Loading branch information
xylix committed Jul 3, 2017
2 parents e0306a7 + 43eaa48 commit 759dc24
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/resources/elements/optionfield-dropdown-ie.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div class="dropdown option field c${columns} columns" if.bind="display">
<label for.bind="id">
${label}
<tooltip if.bind="helpText" text.bind="helpText">
<img src="res/info.svg" alt="Info"/>
</tooltip>
</label>
<select value.bind="selectedChoice" id.bind="id">
<!-- Dropdowns break on IE if we have if.bind, so we don't. -->
<option
repeat.for="choice of allChoices"
model.bind="choice.key"
>${choice.label}</option>
</select>
</div>
</template>
4 changes: 4 additions & 0 deletions src/resources/elements/optionfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ export class Optionfield extends Field {
* @private
*/
getViewStrategy() {
// Dropdowns break on IE, so we have a separate HTML file for IE.
if (!!document.documentMode && this.format === 'dropdown') {
return `resources/elements/optionfield-${this.format}-ie.html`;
}
return `resources/elements/optionfield-${this.format}.html`;
}
}

0 comments on commit 759dc24

Please sign in to comment.