@@ -5,7 +5,13 @@ import { QColorizeMixin } from 'q-colorize-mixin'
55import props from './utils/props.js'
66
77// Quasar
8- import { QBtn , QScrollArea , QTooltip , QPagination } from 'quasar'
8+ import {
9+ QBtn ,
10+ QScrollArea ,
11+ QTooltip ,
12+ QPagination ,
13+ QResizeObserver
14+ } from 'quasar'
915
1016export default {
1117 name : 'QIconPicker' ,
@@ -24,7 +30,9 @@ export default {
2430 itemsPerPage : 0 ,
2531 totalPages : 0
2632 } ,
27- categories : [ ]
33+ categories : [ ] ,
34+ width : '100%' ,
35+ height : '100%'
2836 }
2937 } ,
3038
@@ -274,11 +282,21 @@ export default {
274282 return true
275283 } ,
276284
285+ __onResize ( size ) {
286+ this . width = size . width
287+ this . height = size . height
288+ } ,
289+
277290 __renderBody ( h ) {
278291 return h ( 'div' , {
279- staticClass : 'q-icon-picker__body'
292+ staticClass : 'q-icon-picker__body col column '
280293 } , [
281- this . __renderScrollArea ( h )
294+ this . __renderScrollArea ( h ) ,
295+ h ( QResizeObserver , {
296+ on : {
297+ resize : this . __onResize
298+ }
299+ } )
282300 ] )
283301 } ,
284302
@@ -316,7 +334,11 @@ export default {
316334 __renderScrollArea ( h ) {
317335 return h ( QScrollArea , {
318336 ref : 'scrollArea' ,
319- staticClass : 'q-icon-picker__scroll-area fit'
337+ style : {
338+ width : this . width + 'px' ,
339+ height : this . height + 'px'
340+ }
341+ // staticClass: 'q-icon-picker__scroll-area col column'
320342 } , [
321343 this . __renderContainer ( h )
322344 ] )
@@ -325,7 +347,7 @@ export default {
325347 __renderContainer ( h ) {
326348 const container = h ( 'div' , {
327349 key : this . computedPagination . page ,
328- staticClass : 'q-icon-picker__container row '
350+ staticClass : 'q-icon-picker__container col '
329351 } , [
330352 ...this . __renderIcons ( h )
331353 ] )
@@ -394,8 +416,8 @@ export default {
394416
395417 render ( h ) {
396418 const picker = h ( 'div' , this . setBothColors ( this . color , this . backgroundColor , {
397- ref : 'icon- picker' ,
398- staticClass : 'q-icon-picker flex '
419+ ref : 'picker' ,
420+ staticClass : 'q-icon-picker column '
399421 } ) , [
400422 this . __renderBody ( h ) ,
401423 this . noFooter !== true && this . pagination !== void 0 && this . __renderFooter ( h )
0 commit comments