mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
add aria-label to form inputs
This commit is contained in:
parent
1d831fcfd8
commit
281742addd
@ -134,6 +134,11 @@ define(req, function(AppConfig, Default, Language) {
|
||||
}
|
||||
};
|
||||
|
||||
Messages.form_input_ph_text = "Your answer here"; // XXX used in form input placeholders, should be generic enough to be used in all contexts
|
||||
Messages.form_input_ph_number = "Enter a number"; // XXX same as above but for number inputs
|
||||
// text & number were missing from the existing list
|
||||
// "form_input_ph_email": "email@example.com",
|
||||
// "form_input_ph_url": "https://example.com",
|
||||
return Messages;
|
||||
|
||||
});
|
||||
|
||||
@ -1699,10 +1699,13 @@ define([
|
||||
var tag = h('input', {
|
||||
type: opts.type,
|
||||
step: "any",
|
||||
placeholder: Messages['form_input_ph_'+opts.type] || ''
|
||||
'aria-label': Messages['form_input_ph_'+opts.type],
|
||||
placeholder: Messages['form_input_ph_'+opts.type]
|
||||
});
|
||||
var $tag = $(tag);
|
||||
$tag.on('change keypress keydown', Util.throttle(function () {
|
||||
let currentVal = $tag.val().trim();
|
||||
$tag.attr('aria-label', currentVal || Messages['form_input_ph_'+opts.type] || '');
|
||||
evOnChange.fire();
|
||||
}, 500));
|
||||
var cursorGetter;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user