ahn / vaadin-aceeditor

Vaadin wrapper for Ace editor
Apache License 2.0
24 stars 37 forks source link

Problem with keybindings #45

Open rjahn opened 9 years ago

rjahn commented 9 years ago

Keybindings don't works as expected if you define an action handler for the UI:

public class SimpleUI extends UI
{
  @Override
  protected void init(VaadinRequest request)
  {
    AceEditor ace = new AceEditor();
    ace.setMode(AceMode.java);
    ace.setTheme(AceTheme.tomorrow_night_bright);
    ace.setValue("public void functional(String pValue)\n{\n}");

    HorizontalLayout hlayout = new HorizontalLayout(ace);

    setContent(hlayout);

    addActionHandler(new Handler()
    {
      public void handleAction(Action action, Object sender, Object target)
      {
        //Global default button handling
      }

      public Action[] getActions(Object target, Object sender)
      {
        return new Action[] {new ShortcutAction("ENTER", ShortcutAction.KeyCode.ENTER, null)};
      }
    });
  }
}

ACE editor doesn't insert a newline with this example.

EduFrazao commented 8 years ago

Man, this is a serious bug. Any workaround?