No maxlength attribute on input fields for GPS coordinates #9816

Closed
opened 2025-12-29 21:23:06 +01:00 by adam · 2 comments
Owner

Originally created by @RasmusThing on GitHub (Jun 8, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.5

Python Version

3.11

Steps to Reproduce

When entering latitude and longitude for a site object in NetBox, there is no max length on the input fields.
This shows an error when entering coordinates longer than what is permitted in NetBox.

image

Expected Behavior

For a better user experience, both input fields should have a maxlength attribute added to automatically cut off the excessive decimals.
image

Observed Behavior

When entering GPS coordinates for a site object in NetBox that are longer than whats permitted, an error is shown instead of cutting off the coordinates automatically.

Originally created by @RasmusThing on GitHub (Jun 8, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.5 ### Python Version 3.11 ### Steps to Reproduce When entering latitude and longitude for a site object in NetBox, there is no max length on the input fields. This shows an error when entering coordinates longer than what is permitted in NetBox. <img width="728" alt="image" src="https://github.com/netbox-community/netbox/assets/11932377/97e5f918-d67b-4e76-b012-7a84ae3c557e"> ### Expected Behavior For a better user experience, both input fields should have a maxlength attribute added to automatically cut off the excessive decimals. <img width="728" alt="image" src="https://github.com/netbox-community/netbox/assets/11932377/5874ce6c-b0a5-4a86-a850-4934fdb14edf"> ### Observed Behavior When entering GPS coordinates for a site object in NetBox that are longer than whats permitted, an error is shown instead of cutting off the coordinates automatically.
adam added the type: bugseverity: low labels 2025-12-29 21:23:06 +01:00
adam closed this issue 2025-12-29 21:23:06 +01:00
Author
Owner

@Julio-Oliveira-Encora commented on GitHub (Jun 11, 2024):

Could you please assign it to me?

@Julio-Oliveira-Encora commented on GitHub (Jun 11, 2024): Could you please assign it to me?
Author
Owner

@arthanson commented on GitHub (Jun 17, 2024):

I don't think this is fixable as-is, as the decimalfield uses NumberInput and in current HTML, there is no support for the size and maxlength attributes for the number input field. @RasmusThing I will close this, can you please open a feature request if you still desire this as it isn't a bug per-se and would require a custom input widget.

@arthanson commented on GitHub (Jun 17, 2024): I don't think this is fixable as-is, as the decimalfield uses NumberInput and in current HTML, there is no support for the size and maxlength attributes for the number input field. @RasmusThing I will close this, can you please open a feature request if you still desire this as it isn't a bug per-se and would require a custom input widget.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9816