Пример #1
0
        /// <summary>Called when the element is focused.</summary>
        internal override void OnFocusEvent(FocusEvent fe)
        {
            if (!IsTextInput() || Caret != null)
            {
                return;
            }

            if (innerHTML == Placeholder_ && Placeholder_ != "")
            {
                innerHTML = "";
            }

            // Add a caret.
            Caret = Style.Computed.GetOrCreateVirtual(HtmlCaretElement.Priority, "caret") as HtmlCaretElement;
        }
Пример #2
0
        /// <summary>Called when the element is unfocused/blurred.</summary>
        internal override void OnBlurEvent(FocusEvent fe)
        {
            if (Caret == null)
            {
                return;
            }

            // Remove the caret:
            Style.Computed.RemoveVirtual(HtmlCaretElement.Priority);
            Caret = null;

            if (innerHTML == "" && Placeholder_ != "")
            {
                innerHTML = Placeholder_;
            }
        }