Thanks to visit codestin.com
Credit goes to github.com

Skip to content

contentEditable attribute doesn't work in gridstack #939

Closed
@Hedva

Description

@Hedva

Just wanted to point out that contentEditable="true" in gridstack behaves weird.
I only have tried it to use it in Two Grids Demo.

It doesn't work.

  <div class="grid-stack-item" data-gs-width="4" data-gs-height="1" data-gs-min-width="2" data-gs-max-width="4" data-gs-min-height="1" data-gs-max-height="4">
  <div class="grid-stack-item-content" contentEditable="true">Titel</div>
</div>

It works partially when settings $(this).focus(); on a onclick event;

<div class="grid-stack-item" data-gs-width="4" data-gs-height="1" data-gs-min-width="2" data-gs-max-width="4" data-gs-min-height="1" data-gs-max-height="4">
  <div class="grid-stack-item-content" contentEditable="true" onclick='$(this).focus();'>Titel</div>
</div>

This makes the content editable. But it makes it only able to put yourr mouse pointer in front of the text Can't put the mouse curser in between characters, or selecting all text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions