Hi,
too bad the Firefox developers can't read a spec correctly :P
https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#the-readonly-attribute
"The difference between disabled and readonly is that read-only controls
are still focusable, so the user can still select the text and interact
with it, whereas disabled controls are entirely non-interactive."
All text on a web page is 'entirely non-interactive', nevertheless I can
still select and copy it. IMHO copying text from a disabled input
doesn't mean I'm interacting with it.
But what's wrong with this solution:
input.add(new Behavior() {
@Override
public void onComponentTag(Component component,
ComponentTag tag) {
super.onComponentTag(component, tag);
if (component.isEnabled() == false) {
tag.remove("disabled");
tag.put("readonly", "readonly");
}
}
}));
You can add this behavior to all your inputs via an
IComponentInstantiationListener.
Regards
Sven
On 02.12.2016 10:07, Dan Haywood wrote:
The Apache Isis project [1] uses Wicket for its main viewer, and we
recently had this question [2] on our mailing list is:
I believe it was mentioned once in another thread that selecting text
(and so copying) from a disabled field doesn't work in Firefox on
Windows. Since a week or two it's not possible on a lot of Chrome
installations of our users either, probably due to a Chrome update. This
really is a big problem for our users because we share a lot of
configuration data for internet access and telephony services and
copying data makes sure they don't make mistakes while configuring their
systems.
Would it be a problem to use the read only attribute instead of the
disabled attribute? That would be an easy fix.
Martin G suggested a possible fix using CSS, but unfortunately to no
avail. Since this presumably could impact all Wicket users, the suggestion
[3] was to re-raise the question here.
So, are there any thoughts on this? Is there any way to enable select text
for a disabled input field for both latest Chrome and Firefox?
Thx
Dan
[1] http://isis.apache.org/
[2]
https://lists.apache.org/thread.html/354ff5bb35c3dd60fbe643f824951c9665aa7546d79562cf15e014f7@%3Cusers.isis.apache.org%3E
[3]
https://lists.apache.org/thread.html/566709f02cc6a4607d1f86d98e19ec1e7d39a2a255dc9895d5800635@%3Cusers.isis.apache.org%3E
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]