---
sidebar_label: Locator.setEnsureElementIsInTheViewport
---

# Locator.setEnsureElementIsInTheViewport() method

#### Signature:

```typescript
class Locator {
  setEnsureElementIsInTheViewport<ElementType extends Element>(
    this: Locator<ElementType>,
    value: boolean
  ): Locator<ElementType>;
}
```

## Parameters

| Parameter | Type                                                 | Description |
| --------- | ---------------------------------------------------- | ----------- |
| this      | [Locator](./puppeteer.locator.md)&lt;ElementType&gt; |             |
| value     | boolean                                              |             |

**Returns:**

[Locator](./puppeteer.locator.md)&lt;ElementType&gt;
