diff --git a/dash/dash.py b/dash/dash.py index 44fad1efee..a69154d10a 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -339,9 +339,14 @@ def _generate_config_html(self): ).format(json.dumps(self._config())) def _generate_meta_html(self): + has_ie_compat = any( + x.get('http-equiv', '') == 'X-UA-Compatible' + for x in self._meta_tags) has_charset = any('charset' in x for x in self._meta_tags) tags = [] + if not has_ie_compat: + tags.append('') if not has_charset: tags.append('') for meta in self._meta_tags: diff --git a/tests/test_integration.py b/tests/test_integration.py index 770b9152cb..b04675195b 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -272,10 +272,10 @@ def display_output(react_value, flow_value): self.percy_snapshot(name='flowtype') def test_meta_tags(self): - metas = ( + metas = [ {'name': 'description', 'content': 'my dash app'}, - {'name': 'custom', 'content': 'customized'} - ) + {'name': 'custom', 'content': 'customized'}, + ] app = dash.Dash(meta_tags=metas) @@ -285,12 +285,12 @@ def test_meta_tags(self): meta = self.driver.find_elements_by_tag_name('meta') - # -1 for the meta charset. - self.assertEqual(len(metas), len(meta) - 1, 'Not enough meta tags') + # -2 for the meta charset and http-equiv. + self.assertEqual(len(metas), len(meta) - 2, 'Not enough meta tags') - for i in range(1, len(meta)): + for i in range(2, len(meta)): meta_tag = meta[i] - meta_info = metas[i - 1] + meta_info = metas[i - 2] name = meta_tag.get_attribute('name') content = meta_tag.get_attribute('content') self.assertEqual(name, meta_info['name'])