Open WillsterJohnson opened 1 week ago
@WillsterJohnson I also don't see any problem just adding the support for new types. As you said old apps will work as before and if they use new types they get some crash. Maybe there are ways to handle an error. Could you provide a PR please?
Describe the bug According to mdn, there are 22 valid input types, however
qx.bom.Input
only supports 13, of which 2 are not valid input types (textarea
andselect
are their own html elements distinct from<input>
).To Reproduce Steps to reproduce the behavior:
Expected behavior An instance of
qx.html.Element
withtagName="input"
andattributes={type:"number"}
should be created viaqx.html.Jsx.createElement
Screenshots![Screenshot](https://github.com/qooxdoo/qooxdoo/assets/85991558/1cd19c40-05a4-4fb5-ba84-9e740a266c57)
Desktop (please complete the following information):
Additional context This issue makes it impossible to use half of the available input types in jsx, importantly the
number
type.Proposed Solution:
qx.bom.Input
, expose the static__types
field publicly astypes
qx.html.Factory
constructor atthis.registerFactory("input",...)
, check that the given type exists as a key ofqx.bom.Input.types
. If so, then continue with the current behavior. Otherwise, fallback to creating a plainqx.html.Element
This would only change the behavior of code which would otherwise throw an error and crash the application, so is shouldn't have any impact on existing code.