@@ -7,6 +7,7 @@ import ClayIcon from '@clayui/icon';
7
7
import ClayLabel from '@clayui/label' ;
8
8
import ClayLayout from '@clayui/layout' ;
9
9
import { InternalDispatch , sub } from '@clayui/shared' ;
10
+ import { ClayTooltipProvider } from '@clayui/tooltip' ;
10
11
import classNames from 'classnames' ;
11
12
import React from 'react' ;
12
13
@@ -136,7 +137,7 @@ const getTranslationLabel = ({
136
137
if ( translation ) {
137
138
const { total, translated} = translation ;
138
139
139
- if ( total !== 0 ) {
140
+ if ( translated !== 0 ) {
140
141
if ( localeId === defaultLocaleId ) {
141
142
displayType = 'info' ;
142
143
label = messages . default ;
@@ -175,35 +176,38 @@ const Trigger = React.forwardRef<HTMLButtonElement>(
175
176
) ;
176
177
177
178
return (
178
- < button
179
- { ...otherProps }
180
- aria-label = { sub ( triggerMessage , [
181
- selectedItem ?. name || selectedItem ?. label ,
182
- ] ) }
183
- className = { classNames (
184
- classNamesTrigger ,
185
- 'form-control form-control-select form-control-select-secondary' ,
186
- {
187
- 'form-control-shrink' : triggerShrink ,
188
- 'form-control-sm' : small ,
189
- 'hidden-label' : hideTriggerText ,
190
- }
191
- ) }
192
- ref = { ref }
193
- >
194
- < span className = "inline-item-before" >
195
- < ClayIcon
196
- spritemap = { spritemap }
197
- symbol = { selectedItem . symbol }
198
- />
199
- </ span >
200
-
201
- { ! hideTriggerText ? (
179
+ < ClayTooltipProvider >
180
+ < button
181
+ { ...otherProps }
182
+ aria-label = { sub ( triggerMessage , [
183
+ selectedItem ?. name || selectedItem ?. label ,
184
+ ] ) }
185
+ className = { classNames (
186
+ classNamesTrigger ,
187
+ 'form-control form-control-select form-control-select-secondary' ,
188
+ {
189
+ 'form-control-shrink' : triggerShrink ,
190
+ 'form-control-sm' : small ,
191
+ 'hidden-label' : hideTriggerText ,
192
+ }
193
+ ) }
194
+ title = { hideTriggerText ? selectedItem . label : null }
195
+ ref = { ref }
196
+ >
202
197
< span className = "inline-item-before" >
203
- { selectedItem . label }
198
+ < ClayIcon
199
+ spritemap = { spritemap }
200
+ symbol = { selectedItem . symbol }
201
+ />
204
202
</ span >
205
- ) : null }
206
- </ button >
203
+
204
+ { ! hideTriggerText ? (
205
+ < span className = "inline-item-before" >
206
+ { selectedItem . label }
207
+ </ span >
208
+ ) : null }
209
+ </ button >
210
+ </ ClayTooltipProvider >
207
211
) ;
208
212
}
209
213
) ;
0 commit comments