eclipsesource / eclipsesource/tabris-js

Property 'contentView' doesn't exist on type 'Popover'.

Open
#1,718 6 comments 0 reactions 1 assignee Claimed by @tbuschto View on GitHub
bug doc TypeScript/JSX
Dominant language
JavaScript
Stars
1.4k
Forks
171
PR merge metrics
No merged PRs in 30d

Description

### Problem description

In popover.js snippet `Popover` widget, `contentView` is not existing as a property of the widget.

### Expected behavior

Programmer should be able to attach provided widgets to `Popover.contentView` similarly to `tabris.ui.contentView`.

### Environment

- Tabris.js version: 2.5.1

### Code snippet
```typescript
import { Action, NavigationView, Page, Popover, Button, TextView, ui, device } from 'tabris';

const button = new Button({
left: 16, right: 16, top: 24,
text: 'Show Popover'
}).on({select: () => showPopover})
.appendTo(ui.contentView);

function showPopover() {
const popover = new Popover({width: 300, height: 400, anchor: button})
.on({close: () => console.log('Popover closed')})
.open();
const navigationView = new NavigationView({
layoutData: {left: 0, right: 0, top: 0, bottom: 0},
navigationAction: new Action({
title: 'Close',
image: {
src: device.platform === 'iOS' ? 'resources/close-black-24dp@3x.png' : 'resources/close-white-24dp@3x.png',
scale: 3
}
}).on('select', () => popover.close())
}).appendTo(popover.contentView);
const page = new Page({title: 'Popover'}).appendTo(navigationView);
new TextView({centerX: 0, centerY: 0, text: 'Hello popover'}).appendTo(page);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.