Skip to content

input problem

In the tasks interface, sometimes the topicblock changes into an input element , it is not sure how that happens. But it is certainly an option of the tree implementation which has a separate input.js file attached.

Options

  • see how it is triggered. so we can reproduce it more easily
  • disable that input functionality
  • get the functionality working.

We probably want this disabled since we want the description to be editable as well when we get to tasks.

reproduce

Easy !, click (mousedown) on a toolbar for about a second. It now turns into an input bar with this content.

folderrootadd_circledo_not_disturb_onmore_vert

So that seems to be all icon names in the topicbar, including the caption name.

  • folder
  • root
  • add_circle
  • do_not_disturb_on
  • more_vert

Note that the folder icon is there but not the 'open/close' triangle which is still visible.

So that is all the html content of all subelements. I would suggest just to

functionality

The tree implementation just assumes plain innerHTML and not a complete TopicBlock. So it let's you edit it. So we can't use this and it should be disabled.

disable

In the tree implementation, there is an import for Input. But we cannot just remove the Input object since it has a vital role in drag and drop.

But there is a simple solution, there is an option called holdTime

     * @param {number} [options.holdTime=2000] number of milliseconds to press and hold name before editing starts (set to 0 to disable)

With a disable option : set to 0. So we should pass some more options to the tree from now on.

I create a tree like this.

  build_tree(parent)
    {
        this.yytree = new Tree(this.data, {
            parent: parent,
            block: new TopicBlock()
        } )
        return this.yytree
    }

So to add some custom options to it, we extend the second parameter.

 this.yytree = new Tree(this.data, {
            parent: parent,
            block: new TopicBlock(),
            holdTime: 0
        } )

Fixed !!