? Pending

User tests: Successful: Unsuccessful:

avatar chmst
chmst
30 May 2018

In Article and Contact, the fields "id" and "hits" are readonly. The size attribute makes arrows for numer-dropdown. This is confusing. Filering too is not necessary if no input is allowed.

This is the same for staging and 4.0.

Summary of Changes

Remove the size Attribute from number fields which are readonly.

Testing Instructions

Open an article - have a look on the publishing tab.
size-number-readonly

Apply the patch and the Fields are readonly without the arrows.

Documentation Changes Required

maybe - if there are screenshots

avatar chmst chmst - open - 30 May 2018
avatar chmst chmst - change - 30 May 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 May 2018
Category Unit Tests Repository Administration com_admin
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 31 May 2018

Isn't it a Firefox-Issue?

avatar infograf768 infograf768 - change - 31 May 2018
Title
No size for readonly number fields
[4.0] No size for readonly number fields
avatar infograf768 infograf768 - edited - 31 May 2018
avatar joomla-cms-bot joomla-cms-bot - change - 31 May 2018
Category Unit Tests Repository Administration com_admin Administration com_contact com_content
avatar infograf768
infograf768 - comment - 31 May 2018

Same issue here with Safari.
The issue is that someone systematically changed these fields to number. #18199
See also #18415
Staging is also concerned.
I fail to understand the use of number when field is readonly.

avatar SharkyKZ
SharkyKZ - comment - 31 May 2018

Restore filter="unset" please.

avatar SharkyKZ
SharkyKZ - comment - 31 May 2018

Filering too is not necessary if no input is allowed.

Filtering is needed. readonly is a client-side restriction. Which means it can be circumvented easily. E.g. by entering a value through developer tools or removing the attribute itself the same way. Server-side validation/filtering is a must.

Also unset filter prevents data from being saved to database. We need this to ensure that we don't overwrite hits value.

avatar chmst chmst - change - 31 May 2018
Labels Added: ? ?
avatar chmst
chmst - comment - 31 May 2018

I have restored the filter="unset". And I too would use type="text" here. So I am ready to change it to type="text". But it does not make a difference in the behaviour.

avatar brianteeman
brianteeman - comment - 31 May 2018

Semantically it is a number field not a text field
For assistive technology it is a number field not a text field

Changing it to a text field to work around a visual guide you don't like is a wrong approach

avatar chmst
chmst - comment - 31 May 2018

Using a number field with size when input is allowed was good, but I see now that over all components at least the "id" field is not consistent, in backend as well as in frontend.
Sometimes the field is hidden and has type="numeric" and a size (i.e. note.xml), sometimes the hidden field has no other attributes (i.e. override.xml, category/edit.xml)).
If the field is not hidden, it is always readonly but has different definitons. (i.e. item

Which is the correct definition for a hidden field?
Which definition to use if the field is visible but readonly?

Can we make a rule for that to avoid inconsitent use in components?

avatar infograf768
infograf768 - comment - 31 May 2018

For assistive technology it is a number field not a text field

Reference?

avatar SharkyKZ
SharkyKZ - comment - 31 May 2018

Which is the correct definition for a hidden field?

Hidden type fields don't need any visual attributes (class, size, readonly).

IMO, ID field should be visible across all forms in backend but hidden in frontend.

Which definition to use if the field is visible but readonly?

Size attribute either needs to be reviewed and updated across the board or removed entirely. Currently its use seems random at best and it has no effect in core because default templates control input size anyways. class="readonly" can be removed.

avatar brianteeman
brianteeman - comment - 31 May 2018

Size is not a valid attribute for a number type field

elements of type "number" don't support form sizing attributes such as size. You'll have to resort to CSS to change the size of these controls.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

avatar zwiastunsw
zwiastunsw - comment - 31 May 2018
avatar ReLater
ReLater - comment - 31 May 2018

Concerning spin-buttons. Maybe something horrible like this in CSS?

<style>
input[type=number][readonly]::-webkit-outer-spin-button,
input[type=number][readonly]::-webkit-inner-spin-button
{
 -webkit-appearance: none;
}

input[type=number][readonly]
{
 -moz-appearance: textfield;
}
</style>
avatar wilsonge wilsonge - change - 14 Jun 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-06-14 22:47:08
Closed_By wilsonge
Labels Removed: ?
avatar wilsonge wilsonge - close - 14 Jun 2018
avatar wilsonge wilsonge - merge - 14 Jun 2018
avatar wilsonge
wilsonge - comment - 14 Jun 2018

Looks good to me! Thanks!

Add a Comment

Login with GitHub to post a comment