Skip to content

Commit

Permalink
Added test case for #26
Browse files Browse the repository at this point in the history
  • Loading branch information
mstahv committed Jan 2, 2024
1 parent aeff657 commit 44f2a89
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/test/java/org/vaadin/tinymce/UpdateValueOnDetachedEditor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.vaadin.tinymce;

import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.Route;

import java.time.LocalDateTime;

@Route
public class UpdateValueOnDetachedEditor extends VerticalLayout {
public UpdateValueOnDetachedEditor() {

TinyMce tinyMce = new TinyMce();

Button b = new Button("Replace value while detached");
b.addClickListener(e -> {
tinyMce.removeFromParent();
tinyMce.setValue("Now: " + LocalDateTime.now());
add(tinyMce);
});

add(b, tinyMce);

}
}

0 comments on commit 44f2a89

Please sign in to comment.