mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/17449] Better handling of emoji in site name for webpush manifest
PHPBB-17449
This commit is contained in:
@@ -162,6 +162,22 @@ function parse_document(container)
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Dynamically control a text field's maxlength (allows emoji to be counted as 1 character)
|
||||
*/
|
||||
container.find('#sitename_short').each(function() {
|
||||
const $this = this;
|
||||
const maxLength = $this.maxLength;
|
||||
$this.maxLength = maxLength * 2;
|
||||
$this.addEventListener('input', () => {
|
||||
const inputChars = Array.from($this.value);
|
||||
if (inputChars.length > maxLength) {
|
||||
$this.value = inputChars.slice(0, maxLength).join('');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Responsive tabs
|
||||
*/
|
||||
|
Reference in New Issue
Block a user