Tui.image-editor: Uncaught (in promise) Invalid parameters got this error while using icon

Created on 3 Jan 2019  路  6Comments  路  Source: nhn/tui.image-editor

Whenever I am trying to use icon it gives this error.
And I am not able to write text.

Please help ASAP.
Thank you

Bug

Most helpful comment

@RadhikaMayani @maverick42 @shiorap
I found defaultIcon set initializing is never executed when initMenu option has falsy value.
I'll resolve this issue and release soon. Thanks!

All 6 comments

Hi,

I have exactly the same error when the "initMenu" option is not set ...

image

I have debug code and get error in this function.

` _createClass(Icon, [{
key: 'add',
value: function add(type, options) {
var _this2 = this;

            return new _promise2.default(function (resolve, reject) {
                var canvas = _this2.getCanvas();
                var path = _this2._pathMap[type];
                var selectionStyle = _consts2.default.fObjectOptions.SELECTION_STYLE;
                var registerdIcon = Object.keys(_consts2.default.defaultIconPath).indexOf(type) >= 0;
                var useDragAddIcon = _this2.useDragAddIcon && registerdIcon;
                var icon = path ? _this2._createIcon(path) : null;

                if (!icon) {
                    reject(rejectMessages.invalidParameters);
                }

                icon.set(_tuiCodeSnippet2.default.extend({
                    type: 'icon',
                    fill: _this2._oColor
                }, selectionStyle, options, _this2.graphics.controlStyle));

                canvas.add(icon).setActiveObject(icon);

                if (useDragAddIcon) {
                    _this2._addWithDragEvent(canvas);
                }

                resolve(_this2.graphics.createObjectProperties(icon));
            });
        }`

there is an error in

icon.set(_tuiCodeSnippet2.default.extend({ type: 'icon', fill: _this2._oColor }, selectionStyle, options, _this2.graphics.controlStyle));

It seems it works fine when the initMenu property is set but when left empty or not defined, the icon set doesn't work

@RadhikaMayani @maverick42 @shiorap
I found defaultIcon set initializing is never executed when initMenu option has falsy value.
I'll resolve this issue and release soon. Thanks!

I guess my issue is related to same this issue.

   includeUI: {
          theme: blackTheme,
           ...
          menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'mask', 'filter'],
          initMenu: 'icon',
        }

I don't want to init any initMenu option on load. When i don't then initMenu icon option stop working.

When i add menu and initMenu option togather then menu icon such as Arrow, Arrow-2,Star-1 etc..` work but with wrong canvas position on load.
Am i missing anything ?. I am using Vue version of this repo.

image

HI All, I too face this issue.
I able to draw icon if I initialize initMenu: ['icon'] else I could not draw icon from icon set.
My working environment details are

"@toast-ui/vue-image-editor": "^1.0.2"
Chrome Version 76.0, Windows 10

@junghwan-park is this issue fixed?

Was this page helpful?
0 / 5 - 0 ratings