@@ -176,44 +176,29 @@ export const PgIconButton = forwardRef(({icon, title, shortcut, className, split
176176 shortcutTitle = < ShortcutTitle title = { title } accesskey = { accesskey } shortcut = { shortcut } /> ;
177177 }
178178
179- /* Tooltip does not work for disabled items */
180- if ( props . disabled ) {
181- if ( color == 'primary' ) {
182- return (
183- < PrimaryButton ref = { ref } style = { style }
184- className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
185- accessKey = { accesskey } data-label = { title || '' } { ...props } >
186- { icon }
187- </ PrimaryButton >
188- ) ;
189- } else {
190- return (
191- < DefaultButton ref = { ref } style = { style }
192- className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
193- accessKey = { accesskey } data-label = { title || '' } { ...props } >
194- { icon }
195- </ DefaultButton >
196- ) ;
197- }
198- } else if ( color == 'primary' ) {
179+ if ( color == 'primary' ) {
199180 return (
200181 < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
201- < PrimaryButton ref = { ref } style = { style }
202- className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
203- accessKey = { accesskey } data-label = { title || '' } { ...props } >
204- { icon }
205- </ PrimaryButton >
182+ < span >
183+ < PrimaryButton ref = { ref } style = { style }
184+ className = { [ 'Buttons-iconButton' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
185+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
186+ { icon }
187+ </ PrimaryButton >
188+ </ span >
206189 </ Tooltip >
207190
208191 ) ;
209192 } else {
210193 return (
211194 < Tooltip title = { shortcutTitle || title || '' } aria-label = { title || '' } enterDelay = { isDropdown ? 1500 : undefined } placement = { tooltipPlacement } >
212- < DefaultButton ref = { ref } style = { style }
213- className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
214- accessKey = { accesskey } data-label = { title || '' } { ...props } >
215- { icon }
216- </ DefaultButton >
195+ < span >
196+ < DefaultButton ref = { ref } style = { style }
197+ className = { [ 'Buttons-iconButton' , 'Buttons-iconButtonDefault' , ( splitButton ? 'Buttons-splitButton' : '' ) , className ] . join ( ' ' ) }
198+ accessKey = { accesskey } data-label = { title || '' } { ...props } >
199+ { icon }
200+ </ DefaultButton >
201+ </ span >
217202 </ Tooltip >
218203 ) ;
219204 }
0 commit comments