Merge pull request #1023 from xwiki-labs/form-bugfixes

Form bugfixes
This commit is contained in:
David Benque 2023-04-26 14:01:20 +01:00 committed by GitHub
commit 613ab0f6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -81,6 +81,8 @@ We love Open Source and we love contribution. Learn more about [contributing](ht
If you have any questions or comments, or if you're interested in contributing to CryptPad, come say hi in our [Matrix channel](https://app.element.io/#/room/#cryptpad:matrix.xwiki.com).
This project is tested with [BrowserStack](https://www.browserstack.com/).
# License
![AGPL logo](https://www.gnu.org/graphics/agplv3-155x51.png "GNU Affero General Public License")

View File

@ -166,12 +166,12 @@ define([
};
typeSelect = UIElements.createDropdown(dropdownConfig);
typeSelect.setValue(opts.type);
type = h('div.cp-form-edit-type', [
h('span', Messages.form_textType),
typeSelect[0]
]);
typeSelect.onChange.reg(evOnSave.fire);
}
setCursorGetter(function () {
@ -181,8 +181,10 @@ define([
var getSaveRes = function () {
return {
maxLength: getLengthVal ? getLengthVal() : undefined,
required: opts.required ? true : false,
type: typeSelect ? typeSelect.getValue() : undefined
};
};
evOnSave.reg(function () {
@ -1628,10 +1630,11 @@ define([
// Messages.form_input_ph_email.form_input_ph_url
var tag = h('input', {
type: opts.type,
step: "any",
placeholder: Messages['form_input_ph_'+opts.type] || ''
});
var $tag = $(tag);
$tag.on('change keypress', Util.throttle(function () {
$tag.on('change keypress keydown', Util.throttle(function () {
evOnChange.fire();
}, 500));
var cursorGetter;
@ -4539,6 +4542,7 @@ define([
var endDateStr = h('div');
var $endDate = $(endDateContainer);
var $endDateStr = $(endDateStr);
var refreshEndDate = function () {
$endDate.empty();