fix(xo-web/new-vm): tooltips not showing up on disabled inputs (#4309)

Fixes #4304

mouseenter event not supported on disabled inputs in some browsers
https://devdocs.io/dom_events/mouseenter
This commit is contained in:
HamadaBrest
2019-06-27 10:24:47 +02:00
committed by Pierre Donias
parent a140fc09ac
commit b13f91ec8d
3 changed files with 19 additions and 16 deletions

View File

@@ -19,6 +19,7 @@
- [Metadata backup] Missing XAPIs should trigger a failure job [#4281](https://github.com/vatesfr/xen-orchestra/issues/4281) (PR [#4283](https://github.com/vatesfr/xen-orchestra/pull/4283))
- [Host/advanced] Fix host CPU hyperthreading detection [#4262](https://github.com/vatesfr/xen-orchestra/issues/4262) (PR [#4285](https://github.com/vatesfr/xen-orchestra/pull/4285))
- [iSCSI] Fix fibre channel paths display [#4291](https://github.com/vatesfr/xen-orchestra/issues/4291) (PR [#4303](https://github.com/vatesfr/xen-orchestra/pull/4303))
- [New VM] Fix tooltips not displayed on disabled elements in some browsers (e.g. Google Chrome) [#4304](https://github.com/vatesfr/xen-orchestra/issues/4304) (PR [#4309](https://github.com/vatesfr/xen-orchestra/pull/4309))
### Released packages

View File

@@ -58,6 +58,12 @@ export class TooltipViewer extends Component {
// ===================================================================
// Wrap disabled HTML element before wrapping it with Tooltip
// <Tooltip>
// <div>
// <MyComponent disabled />
// </div>
// </Tooltip>
export default class Tooltip extends Component {
static propTypes = {
children: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),

View File

@@ -1175,10 +1175,8 @@ export default class NewVm extends BaseComponent {
</LineItem>
<br />
<LineItem>
<label>
<Tooltip
content={CAN_CLOUD_INIT ? undefined : _('premiumOnly')}
>
<Tooltip content={CAN_CLOUD_INIT ? undefined : _('premiumOnly')}>
<label>
<input
checked={installMethod === 'SSH'}
disabled={!CAN_CLOUD_INIT}
@@ -1187,10 +1185,10 @@ export default class NewVm extends BaseComponent {
type='radio'
value='SSH'
/>
</Tooltip>
&nbsp;
{_('newVmSshKey')}
</label>
&nbsp;
{_('newVmSshKey')}
</label>
</Tooltip>
&nbsp;
<span className={classNames('input-group', styles.fixedWidth)}>
<DebounceInput
@@ -1218,10 +1216,8 @@ export default class NewVm extends BaseComponent {
</LineItem>
<br />
<LineItem>
<label>
<Tooltip
content={CAN_CLOUD_INIT ? undefined : _('premiumOnly')}
>
<Tooltip content={CAN_CLOUD_INIT ? undefined : _('premiumOnly')}>
<label>
<input
checked={installMethod === 'customConfig'}
disabled={!CAN_CLOUD_INIT}
@@ -1230,10 +1226,10 @@ export default class NewVm extends BaseComponent {
type='radio'
value='customConfig'
/>
</Tooltip>
&nbsp;
{_('newVmCustomConfig')}
</label>
&nbsp;
{_('newVmCustomConfig')}
</label>
</Tooltip>
&nbsp;
<AvailableTemplateVars />
&nbsp;