dropdown: value update issue on iOS 13
html: allow `class`, `title` and `style` attributes
This commit is contained in:
parent
2bd2c51398
commit
94dbc3faba
5 changed files with 25 additions and 7 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
var iOS
|
||||
|
||||
if (navigator.platform.match(/iPhone|iPod|iPad/)) {
|
||||
if (navigator.platform.match(/iPhone|iPod|iPad/) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) {
|
||||
|
||||
iOS = true
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
var Widget = require('../common/widget'),
|
||||
{iconify} = require('../../ui/utils'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw')
|
||||
raw = require('nanohtml/raw'),
|
||||
iOS = require('../../ui/ios')
|
||||
|
||||
class Dropdown extends Widget {
|
||||
|
||||
|
|
@ -81,7 +82,10 @@ class Dropdown extends Widget {
|
|||
|
||||
this.value = this.values[i]
|
||||
|
||||
if (!options.fromLocal) this.select.selectedIndex = i + 1
|
||||
if (!options.fromLocal) {
|
||||
this.select.selectedIndex = i + 1
|
||||
if (iOS && document.activeElement === this.select) this.select.blur()
|
||||
}
|
||||
|
||||
if (options.send) this.sendValue()
|
||||
if (options.sync) this.changed(options)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,11 @@ var Widget = require('../common/widget'),
|
|||
StaticProperties = require('../mixins/static_properties')
|
||||
|
||||
var sanitizeOptions = {
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe')
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2']).filter(x=>x!=='iframe'),
|
||||
allowedAttributes: {
|
||||
'*': [ 'title', 'class', 'style'],
|
||||
'img': [ 'src' , 'title', 'class', 'style', 'width', 'height']
|
||||
}
|
||||
}
|
||||
|
||||
class Html extends StaticProperties(Widget, {bypass: true}) {
|
||||
|
|
@ -27,7 +31,10 @@ class Html extends StaticProperties(Widget, {bypass: true}) {
|
|||
'Allowed HTML tags:',
|
||||
' h1-6, blockquote, p, a, ul, ol, nl, li,',
|
||||
' b, i, strong, em, strike, code, hr, br, div,',
|
||||
' table, thead, img, caption, tbody, tr, th, td, pre'
|
||||
' table, thead, img, caption, tbody, tr, th, td, pre',
|
||||
'Allowed attributes:',
|
||||
' <*>: class, style, title',
|
||||
' <img>: src, width, height',
|
||||
]},
|
||||
border: {type: 'boolean', value: true, help: 'Set to `false` to disable the borders and background-color'},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue