Jemt / Fit.UI

Fit.UI is a JavaScript based UI framework built on Object Oriented principles
http://fitui.org
GNU Lesser General Public License v3.0
19 stars 7 forks source link

Input (DesignMode): Placeholder does not work with auto focus #158

Closed FlowIT-JIT closed 2 years ago

FlowIT-JIT commented 2 years ago

The HTML editor removes a placeholder when it gains focus. This basically means that the Placeholder feature does not work with auto focus.

var ed = new Fit.Controls.Input();
ed.DesignMode(true, { /* editor config */ });
ed.Placeholder("Enter a short text here. You can use @ to mention people.");
ed.Render(document.body);
ed.Focused(true); // Removes placeholder - let's hope it did not contain important information

Work around: Do not auto assign focus

FlowIT-JIT commented 2 years ago

Fixed with commit https://github.com/Jemt/Fit.UI/commit/18148472e4411abe208f2016d549cab0830cbb11