File: no-tether.html

package info (click to toggle)
node-popper2 2.11.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,752 kB
  • sloc: javascript: 23,558; makefile: 20
file content (75 lines) | stat: -rw-r--r-- 1,370 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html> <title>Prevent Overflow Visual Test</title>

<style>
  @import '/reset.css';
  #scroll {
    overflow: scroll;
    width: 584px;
    height: 584px;
    background-color: grey;
  }

  #scroll::before {
    content: 'before';
    display: block;
    height: 1000px;
    width: 1px;
  }

  #scroll::after {
    content: 'after';
    display: block;
    height: 1000px;
    width: 1px;
  }

  #reference {
    width: 200px;
    height: 200px;
    background-color: red;
    box-shadow: inset 0 0 0 1px black;
  }

  #popper {
    width: 100px;
    height: 300px;
    background-color: rebeccapurple;
    box-shadow: inset 0 0 0 1px black;
  }

  #arrow {
    width: 20px;
    height: 20px;
    background-color: yellow;
  }
</style>

<div id="scroll">
  <div id="reference">Reference Box</div>
</div>
<div id="popper">
  Popper Box
  <div id="arrow" data-popper-arrow></div>
</div>

<script type="module">
  import { createPopper } from '../../dist/popper.js';
  const reference = document.querySelector('#reference');
  const popper = document.querySelector('#popper');

  window.instance = createPopper(reference, popper, {
    placement: 'right',
    modifiers: [
      {
        name: 'flip',
        enabled: false,
      },
      {
        name: 'preventOverflow',
        options: {
          tether: false,
        },
      },
    ],
  });
</script>