Skip to content

Commit

Permalink
Added possibility to keep the placeholder on html focused <input>
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed Oct 19, 2023
1 parent 6857b89 commit 2f1a5d6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public void updateText(String text) {
public void updatePromptText(String promptText) {
String placeholder = Strings.toSafeString(promptText);
// In JavaFX, the prompt text is not displayed when the text input has the focus (as opposed to HTML).
// So we reproduce this behaviour here.
if (isJavaFxFocusOwner())
// So we reproduce this behaviour here, unless the application code requests not to do so (using )
if (isJavaFxFocusOwner() && Booleans.isNotTrue(getNode().getProperties().get("webfx-keepHtmlPlaceholder")))
placeholder = ""; // Clearing the placeholder on focused nodes.
Element focusableElement = getHtmlFocusableElement();
if (focusableElement instanceof HTMLInputElement)
Expand Down

0 comments on commit 2f1a5d6

Please sign in to comment.