-
Notifications
You must be signed in to change notification settings - Fork 1
The input Element
The <input> element is a garbage pile with all kinds of input types. Where almost every input type is its own element. As most notably the <textarea>, <select> and <button> elements suggest, which in many ways behave just like <input> elements.
Note: More information can be found in the
howtofolder in the main repo.
An enumerated attribute and the most important attribute from which everything else depends on
text: Just a regular text input for anything
password: Password inputs look a lot like regular text inputs but the input is veiled, only the number of characters can be seen.
This input will be a rather small box, that users can insert text into
<input>"input": {
"border-style": "solid",
"border-radius": "3px",
"outline-offset": "1px",
"padding": "3px",
}input:focus {
outline: solid rgb(45, 140, 180) medium;
}beforeinput: Is fired before input. Cancellation will cancel any edit.
input: The input event is fired after the <input> element is edited.
wheel: The type=number input can be changed by scrolling with the wheel.
def on_wheel(self, event):
if self.type == "number":
self.value += event.delta[1]It's just a lot of "hard" work to implement them all.
The beforeinput event can be listened to, to intercept inputs before they actually happen.
<input> elements are a bit lacking without forms and labels.
A real text cursor is also still missing. Right now, the cursor is always at the end of the input.
The <input> is greyed out, the input element will not receive any browser events.
Most importantly, this rule should technically also apply to all descendant elements.
The <input> is greyed out, the input element's value can not be changed.
However, you can still focus the element