When creating new fields in a temporary scratch layer, if a field type disables the length field (e.g. Date type), the length field is not re-enabled when switching the type back to Text (string), integer or decimal etc. QGIS does not allow the user to change the length of the field anymore. This also occurs after, for example, a Date field has been created and a new field is being set up as a text field.
Steps to reproduce the issue
Create New Temporary Scratch Layer. Note that New Field > Type is already set to 'Text (string)' and the 'Length' field is enabled
Change the New Field > Type dropdown to 'Date'. (Note: the length field is now disabled)
Change Type to 'Text (string)'.
Unable to change the Length value as field is still disabled
What is the bug or the crash?
When creating new fields in a temporary scratch layer, if a field type disables the length field (e.g. Date type), the length field is not re-enabled when switching the type back to Text (string), integer or decimal etc. QGIS does not allow the user to change the length of the field anymore. This also occurs after, for example, a Date field has been created and a new field is being set up as a text field.
Steps to reproduce the issue
Versions
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
QGIS version | 3.28.4-Firenze | QGIS code revision | 6f669a22ac -- | -- | -- | -- Qt version | 5.15.8 Python version | 3.11.2 GDAL/OGR version | 3.6.2 PROJ version | 9.1.1 EPSG Registry database version | v10.076 (2022-08-31) GEOS version | 3.11.1-CAPI-1.17.1 SQLite version | 3.40.1 PostgreSQL client version | unknown SpatiaLite version | 5.0.1 QWT version | 6.1.4 QScintilla2 version | 2.13.3 OS version | Debian GNU/Linux 12 (bookworm) | | | Active Python plugins BreederMap | 0.3.1 processing_saga_nextgen | 0.0.7 simple_tools | 0.4.1 JSONEater-master | 0.3 Serval | 3.10.5 GlobeBuilder | v0.6.0 densityanalysis | 2023.3.13 MetaSearch | 0.3.6 db_manager | 0.1.20 grassprovider | 2.12.99 processing | 2.12.99 sagaprovider | 2.12.99 QGIS version 3.28.4-Firenze QGIS code revision [6f669a22ac](https://github.com/qgis/QGIS/commit/6f669a22ac) Qt version 5.15.8 Python version 3.11.2 GDAL/OGR version 3.6.2 PROJ version 9.1.1 EPSG Registry database version v10.076 (2022-08-31) GEOS version 3.11.1-CAPI-1.17.1 SQLite version 3.40.1 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.4 QScintilla2 version 2.13.3 OS version Debian GNU/Linux 12 (bookworm) Active Python plugins BreederMap 0.3.1 processing_saga_nextgen 0.0.7 simple_tools 0.4.1 JSONEater-master 0.3 Serval 3.10.5 GlobeBuilder v0.6.0 densityanalysis 2023.3.13 MetaSearch 0.3.6 db_manager 0.1.20 grassprovider 2.12.99 processing 2.12.99 sagaprovider 2.12.99 ### Supported QGIS version - [ ] I'm running a supported QGIS version according to the roadmap. ### New profile - [X] I tried with a new QGIS profile ### Additional context _No response_