Issue #768Opened January 16, 2018by frank-tenzing0 reactions

IE browser issue

Question

Code SnippetTEXT
Hi @artf ,

Created this issue due to https://github.com/artf/grapesjs/issues/214 has been closed ...

I cloned the latest repo and run it on IE 11, an error: 
`SCRIPT438: Object doesn't support property or method 'replace' - grapes.min.js (15612,7)` 
demonstrates on the console, when I clicked it, it jumped to the line in 'removeClass' function:
`  function removeClass(v, c) {
    if (v.classList) {
      v.classList.remove(c);
    } else {
      v.className = v.className.replace(c, "");
    }
  }`
The 'v.className' was '**SVGAnimatedString**' type when I debug it, but there is no `replace` function for that type. What is supposed to do here and When will this function be called ? Thank you very much!

Answers (3)

artfJanuary 17, 20180 reactions

@frank-tenzing not sure if it's IE's only error, are you facing this issue with some kind of template (which probably contains some SVG element)?

frank-tenzingJanuary 17, 20180 reactions

Hi @artf , what I have done after cloned the latest repo are

Code SnippetTEXT
1). Replaced the start script with `"start": "webpack-dev-server --open --progress --colors & npm run build:css -- -w",;` 
2). Commented the 
**editor.BlockManager.add('testBlock', {
        label: 'Block',
        attributes: { class:'gjs-fonts gjs-f-b1' },
        content: `<div style="padding-top:50px; padding-bottom:50px; text-align:center">Test block</div>`
      })**
in **index.html**; 

Then when I run it on IE 11, `SCRIPT438: Object doesn't support property or method 'replace'`, `grapes.min.js (15612,7)` is showing on the console. 
`  function removeClass(v, c) {
    if (v.classList) {
      v.classList.remove(c);
    } else {
      v.className = v.className.replace(c, "");
    }
  }`

And when I debugged it, `v.className` parsed as **SVGAnimatedString**.
artfJanuary 18, 20180 reactions

@frank-tenzing thanks, but what about other browsers?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.